Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Generating unique Order No
Message
De
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:
01407037
Vues:
36
>>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
Edward Pikman
Independent Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform