Tools Links Login

UniqueID Function

One-Liner to generate a unique Id. Does NOT require a database. No autonumber fields needed.

Original Author: John W. Lowther, Jr.

Assumptions

Assumes the system clock is never reset to a previous time. Could generate duplicate's if the system clock is reset to a prevoius time, but not likely due to the precision of the function.

Returns

UniqueID based on the System Clock

Code

Public Function GetUniqueId() As String
  GetUniqueId = Trim(Str(CDbl(Now) * 10000000000#))
End Function

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 68 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Comments

No comments have been added for this post.

You must be logged in to make a comment.