Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sys(3) Function
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00157162
Message ID:
00157380
Vues:
19
Hi Garrett,

>If I understand correctly, CoCreateGuid() keys off the MAC address of the Ethernet card, if one exists, and is therefore guaranteed to be unique between machines with cards. Within a machine, I suppose you could defeat it by resetting the system clock, and running it at exactly the same time.

>As I understand it, if the machine doesn't have an Ethernet card, it uses some other algorithm that is unlikely to produce duplicates.

CoCreateGuid(), according to the documentation, calls UuidCreate(), which uses the Ethernet or token ring hardware address. That function can return a RPC_S_UUID_NO_ADDRESS error if it cannot get this information.

>BTW, the Identity columns in SQL Server 7 are supposed to be GUIDs, so that every row is unique globally, not merely within a table.

As an FYI for other readers of this thread, here's what the documentation says about CoCreateGuid():

"The CoCreateGuid function calls the RPC function UuidCreate, which creates a GUID, a globally unique 128-bit integer. Use the CoCreateGuid function when you need an absolutely unique number that you will use as a persistent identifier in a distributed environment.To a very high degree of certainty, this function returns a unique value - no other invocation, on the same or any other system (networked or not), should return the same value."

I think that the above explains pretty well why SQL Server 7 uses them.

Regards,
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform