July 31, 2010
Resources
BulletApplications
BulletCode Snippets
BulletArticles
BulletBooks
BulletHTML Templates
BulletResource Index
BulletHome
 

Create a GUID

A GUID is a Globally Unique Identifier, basically a 16-Byte string that is guaranteed to be unique.

These can be very useful for all sorts of uses where you need to uniquley identify something.

There is a simple function that allows you to create a GUID that uses the Windows API to guarantee it's unique.

<%
Function createGuid()
  Set TypeLib = Server.CreateObject("Scriptlet.TypeLib")
  tg = TypeLib.Guid
  createGuid = left(tg, len(tg)-2)
  Set TypeLib = Nothing
End Function
%>

The component used by this function (scriptlet.typelib) is installed as a part of the microsoft scripting engines and therfore should always be availible to you.

© 2006 ASP-DEv Site Map | Search | Privacy Policy | About | Advertising | Contact Us | RDF | Text Only Mode  | Print page