Sometimes I wanted to generate a unique ID. I often uses random number combined with date/time. But, recently I found better way of getting that.
The trick is to use "GUID". It is kind of guaranteed to generate a unique ID.
If you are using VBscript, then the function is like this:
public function GenGUID()
dim TypeLib,strTG
Set TypeLib = Server.CreateObject("Scriptlet.TypeLib")
strTG = TypeLib.Guid
GenGUID = mid(strTG, 2,len(strTG)-4)
Set TypeLib = Nothing
end function
If you are using .NET language, then use the built-in function:
System.Guid.NewGuid.ToString()