Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Auto ID Field
Message
From
21/04/1998 19:25:14
 
 
To
21/04/1998 19:22:01
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00093850
Message ID:
00093851
Views:
26
>Does anyone know how to establish a field in Visual FoxPro database which acts as an AutoID? For example when a user enters a new record this particular field will automatically increment. I know how to do this in MS Access, but not in FoxPro. Can Anyone help?
>
>Thanks,
>Bob

An easy way to do it would be to set the Default value for a Character(10) field in the table to "=SYS(2015)". This gives it a guaranteed unique value, similar to Access GUID. It's not sequential but it works great for primary keys.
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform