Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Consecutive folios in multiuser environment
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01658516
Message ID:
01658533
Vues:
65
>Hi, I need help; I need to use consecutive folios in a native table of FoxPro (DBF) in multiuser environment. How do I make the folios not duplicate? Any function?

Hi Francisso, the old function
SYS(2015)
can help you. This will generate a non duplicate string with 10 characters. In example:
MESSAGEBOX(SYS(2015)+CHR(13)+SYS(2015)+CHR(13)+SYS(2015)+CHR(13)+SYS(2015)+CHR(13)+SYS(2015)+CHR(13)+"5 consecutive aleatory strings",0,"sys(2015)")
***or maybe you want this complete 28 chars string: year+month+day+hour+minute+second string:
MESSAGEBOX(SYS(2015)+STR(YEAR(DATE()),4)+PADL(MONTH(DATE()),2,'0')+PADL(DAY(DATE()),2,'0')+PADL(HOUR(DATETIME()),2,'0')+PADL(minute(DATETIME()),2,'0')+LEFT(TIME(),2)+SUBSTR(TIME(),4,2)+SUBSTR(TIME(),7,2),0,"28 chars string")
Just adjust your primary key and this will help you. I'm sure you won't have a duplicate key using this.
John Harold Belalcázar Lozano
Associate Director Of Development
http://www.belvicto.co/
jhbelalc@gmail.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform