Global Unique Ids (GUIDs) can be very useful in naming files, folders or database records. GUIDs are guaranteed to be unique irrespective of the origin.
"Scriptlet.Typelib" is an object that is normally used to generate a type library for Windows Script Component dynamically. By design, the object creates a GUID if one is not provided, so this feature is used to create GUIDs.
The following code shows how to create a GUID in Visual Basic Script:
Set x = CreateObject("Scriptlet.TypeLib")
strNewGuid=Left(x.GUID, 38)
In order to generate 5 GUIDs, the following code sample may be used:
For n = 1 to 5
  uniqueid(n) = Left(CreateObject("Scriptlet.Typelib").guid, 38)
Next n
 Latest Newsletter
 Latest Newsletter
	
		 Demos
 Demos
	
		 Microsoft Access Developer Help Center
 Microsoft Access Developer Help Center
	
		 Microsoft Access Query Help Center
 Microsoft Access Query Help Center
	
		 MS Access to SQL Server Upsizing
 MS Access to SQL Server Upsizing
	
		 Microsoft Outlook Tips
 Microsoft Outlook Tips
	
		 Technical Papers
 Technical Papers
	
		 Tips and Techniques
 Tips and Techniques
	
		 Videos
 Videos
Thank you! Thank you! I just finished reading this document, which was part of a link in the recent Buzz newsletter. I have printed it for others to read, especially those skeptical on the powers of Access and its capabilities.
Darren D.
		
        	 All Our Microsoft Access Products
        
        All Our Microsoft Access Products