Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Retrieving PKs from an inserted row (CursorAdapter)
Message
From
26/10/2003 11:38:20
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00841822
Message ID:
00842731
Views:
23
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.
Previous
Reply
Map
View

Click here to load this message in the networking platform