Randomly Generated Strings

S

Stuart

Hi All,

I used to have a piece of code that would generate a random string of
8,16,24 or 32 characters in length.

I got it from this group, does any one have this piece of code?

It will be used for a double opt-in email newsletter.


Many thanks,

Stuart
 
R

Roji. P. Thomas

It should be something like (out of my head, not tested)

function GetRandomString(len as integer)
Dim strLetters as string
Dim strResult as String
Dim i as Integer
strLetters = '01234567890ABCDEFHIJKLMNOPQRSTUVWZYZ'

For i = 0 to len
strResult = strResult & SUBSTR(strLetters , FLOOR(RAND() * 36))+1, 1)
Next
GetRandomString = strResult
End function
 
S

Stuart

Many thanks Guys.


I will save the code away somewhere safe - but not so safe that I cannot
find it.

;o))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top