Hi,
I am working on a system that creates a logical file structure with folders stored in a database. I each folder has a unique identifier. My function to create this is with code I got from the Microsoft website:
For some mysterious reason I am getting the occasional folders created with identical GUID values which I would have thought should be extremely unlikely. I also store files in the database with a GUID as well and these also get duplicated from time to time.
Any ideas as to why this might be happening? I thought Randomize Timer was meant to address this sort of issue...
Thanks very much
Ed
I am working on a system that creates a logical file structure with folders stored in a database. I each folder has a unique identifier. My function to create this is with code I got from the Microsoft website:
Code:
Function CreateGUID()
Randomize Timer
Dim tmpCounter,tmpGUID
Const strValid = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
For tmpCounter = 1 To 20
tmpGUID = tmpGUID & Mid(strValid, Int(Rnd(1) * Len(strValid)) + 1, 1)
Next
CreateGUID = tmpGUID
End Function
For some mysterious reason I am getting the occasional folders created with identical GUID values which I would have thought should be extremely unlikely. I also store files in the database with a GUID as well and these also get duplicated from time to time.
Any ideas as to why this might be happening? I thought Randomize Timer was meant to address this sort of issue...
Thanks very much
Ed