VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



UniqueID Function

by John W. Lowther, Jr. (1 Submission)
Category: Miscellaneous
Compatability: Visual Basic 3.0
Difficulty: Advanced
Date Added: Wed 3rd February 2021
Rating: (4 Votes)

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

Assumes
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.
Code Returns
UniqueID based on the System Clock

Rate UniqueID Function

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

Download this snippet    Add to My Saved Code

UniqueID Function Comments

No comments have been posted about UniqueID Function. Why not be the first to post a comment about UniqueID Function.

Post your comment

Subject:
Message:
0/1000 characters