Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Anyone written code to replace SYS(2015)?
Message
From
26/09/2006 19:06:21
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
26/09/2006 17:39:48
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01157093
Message ID:
01157374
Views:
27
>>Hey, Hilmar. Nice to hear from you again, dude.
>>
>>>Some programmers use GUID - that might be an option. It is somewhat longer, though (16 bytes).
>>
>>GUID? Not familiar with that -- yet! :^). Will give it a look and see
>>what gives. Currently, we're hacking some Intranet PHP web apps, but
>>it looks like we'll be shifting back to full-time VFP soon. One of our
>>sales reps went and did something wonderful and sold two VFP apps we
>>wrote, so it looks like Sameer and I will be lurking here more often,
>>asking dumb newb questions and all :^).
>>
>>Randall
>
>Brief summary - and please note that I am no expert on this: GUID is a Windows function (API) that gives you a 16-byte value, unique in the World (if the computer has a network card), and very likely unique (if it doesn't). The uniqueness is guaranteed because the unique value is calculated on the basis of the MAC address (the network card serial number), which is supposed to be unique. (I heard of cases where they weren't, because of factory defects.)
>
>For this reason - the fact that uniqueness is almost guaranteed - some programmers use GUIDs as a convenient primary key.
>
>However, they are quite long; you might also consider the following alternatives, whether it be for a serial number or for generating unique filenames:
>
>1) If there is a permanent connection to a shared database, store some incremental number there.
>
>2) If there isn't, use a serial number in a local database, and combine it with a unique code assigned to each user.

Hilmar,
Some additions.
On win2K and later MAC address is not used anymore and that's guaranteed to be unique even if produced on a box with no network card (formerly MAC was used and if no network card then LOCAL_ONLY was returned as a result - it's now in its 3rd or 4th format specification, not sure).
Though it looks like it's big it has advantages over other generated keys (ie: no dependency to any database or table or a producer backend).
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform