Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Automatic record numbering
Message
From
16/03/2005 17:21:38
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00996535
Message ID:
00996569
Views:
9
>Hi all, I need a method to compute an automatic account number (one-up-count) for each new record (append blank). Old method (DOS) was to go to bottom of table, then get last account number, compute next account number, commit immediately (save) and move on. With multiple users this worked fine because commit (skip-1) was immediate. In windows, the commit seems to be held in a buffer so multiple user all seem to compute the same next record number because commit (save) is still pending. Any ideas?
>
>Dallas

Have a table with the sequence numbers. Have a function that looks up the last number used, increments it, and returns the incremented value. For security, lock the record while it is incremented.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform