Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Generating unique Order No
Message
 
 
To
18/06/2009 19:11:24
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01406619
Message ID:
01407039
Views:
29
>>>In any case, only assign the number when the record is saved.
>>>
>>>If you need code for getting a sequence from a sequence table, I can search for mine.
>>
>>Hilmar,
>>
>>I've changed my mind - I better add default values and counters table, so I would appreciate the code.
>>
>>Thanks.
>
>It is very old code, actually (may look unelegant):
>
>PROCEDURE gettablecounter
>PARAMETER cTablename
>LOCAL nCounter
>IF seek(cTablename,'counters','tablename')=.f.
>	RETURN 0
>ENDIF
>IF rlock('counters')=.f.
>	RETURN 0
>ENDIF
>nCounter=counters.counter+1
>REPLACE counter with nCounter in counters
>UNLOCK in counters
>RETURN nCounter
>ENDPROC
>
Thanks, Ed. I've already done with this using Cetin's old code.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform