[thelist] ASP Equivalent for CreateUUID() ?

Anthony Baratta Anthony at Baratta.com
Tue Apr 3 01:19:10 CDT 2001

At 10:59 PM 4/2/2001, you wrote:
>Hi Folks,
>Does anyone know if there is an equivalent ASP function that does this:
>cf function CreateUUID() which makes a unique, random, 35 character string.

I rolled my own - you are welcome to use or abuse as you see fit.

nBaseID = Right(Abs(DateDiff("s",Now,#1/1/1998#)),8)
varOrderNumber = Right(Year(now),2) & Month(now) & "-"
                  & Left(nBaseID,2) & "-" & Mid(nBaseID,3,3)
                  & "-" & Right(nBaseID,3)

This uses seconds from the #Date#. You can also add a random 4 digit number 
to the end to increase the chances of uniqueness.

Also, there is a component you can use - if you have access to installing 
ASP components:


Look for GUIDMaker.

Anthony Baratta
Keyboard Jockeys

More information about the thelist mailing list