Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can I use Globally Unique IDentifier (GUID)
Message
From
04/11/2004 08:03:18
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00958008
Message ID:
00958030
Views:
19
>Hi All,
>how can i use which is belows described issue on my tables like newid()
>
>http://support.microsoft.com/support/kb/articles/Q269/3/87.asp
>
>TIA

Soykan,

add Guid_String() as default value for your 32 char field
*--------------------------------------------------------
Function Guid_String()

	declare integer CoCreateGuid in ole32 string @	
	declare integer StringFromGUID2 in ole32 string,string @,integer 
	
	local guid, guidString, n, s
	guid = space(16)
	do case
	case empty(CoCreateGuid(@guid))
		guidString = space(78)
		n = StringFromGUID2(guid, @guidString,len(guidString))
		do case
		case n = len(guidString)/2
			s = chrtran(guidString, chr(0) + '-{}', '')
			return s
		otherwise
			assert FALSE
			return Null
		endcase
	
	otherwise
		assert FALSE
		return Null
	endcase

endfunc
*--------------------------------------------------------------------------
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform