Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Retrieving PKs from an inserted row (CursorAdapter)
Message
De
26/10/2003 11:38:20
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00841822
Message ID:
00842731
Vues:
24
Hello, Martin

Of course you're right - I am aware of advantages of integers. If I'd use them I'd have a lot of headaches to synchronize different databases (which is my case).

Here is the algorithm. I'm sorry, I don't remember where I gathered if from. I believe it was Cetin Basosz, but I'm not sure:
cStrucGUID=SPACE(16)
cGUID=SPACE(80)
nSize=40
IF CoCreateGuid(@cStrucGUID) # 0
	RETURN ""
ENDIF
IF StringFromGUID2(cStrucGUID,@cGUID,nSize) = 0
	RETURN ""
ENDIF
RETURN SUBSTR(STRCONV(LEFT(cGUID,76),6),2,36)
Thank you.

>Hi, Grigore.
>
>>I was more radical than that - I gave up using integers as PK's at all. GUID was my way, generated by the client. It's a CHAR(36). So what? :)
>
>I wouldn't do it for every PK, but I did it for distributed and disconnected environments, for example. What algorithm are you using?
Grigore Dolghin
Class Software.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform