Session specific GUID

M

Mark Jackson

I have a hidden table that is storing information that users type into
a form. There could potentially be several users with copies of the
same form open. In SQL server I used the uniqueidentifier data type to
get a unique GUID that was stored in the table that identified each
user's data so they didn't step on each other. Is there anything like
that in Access? The only references to GUID I have found have been to
the GUID's of various COM objects.

Thx

Mark Jackson
 
G

Graham R Seach

Mark,

You have a couple of choices.

1. Use the form's handle; this is the simplest. It's not a GUID, but it's
likely to be unique.
Me.hWnd

2. Create a GUID. The following is just one way; there are many:
Public Function CreateGUID() As String
Dim TypeLib As Object
Dim sGUID As String

'Create the appropriate object
'Note that Scriptlet.TypeLib should be installed
'on any machine running IIS
Set TypeLib = CreateObject("Scriptlet.TypeLib")

'Grab a GUID
sGUID = TypeLib.guid

'Extract the useful portion of the GUID
CreateGUID = Mid(sGUID, 2, Len(sGUID) - 4)

'Release the object
Set TypeLib = Nothing
End Function

Regards,
Graham R Seach
Microsoft Access MVP
Canberra, Australia
 
M

MikeB

Mark Jackson said:
I have a hidden table that is storing information that users type into
a form. There could potentially be several users with copies of the
same form open. In SQL server I used the uniqueidentifier data type to
get a unique GUID that was stored in the table that identified each
user's data so they didn't step on each other. Is there anything like
that in Access? The only references to GUID I have found have been to
the GUID's of various COM objects.


This will work in Access as well:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wss/wss/_hosting_getguid.asp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top