Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Generating unique Order No
Message
 
 
À
18/06/2009 19:11:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01406619
Message ID:
01407039
Vues:
28
>>>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform