VBScript does *NOT* support METHODS on strings.
tmpString.substring(pos,1)
You are trying to use a substring method, but that's only available in JavaScript and in the .NET languages (and Java, I guess).
Strings are *NOT* objects in VBScript. They are primitive types. So you have to use built in functions.
**********
Various other goofs in your code:
You call RANDOMIZE each time through the loop. That will actually *DESTROY* any attempts to get good random numbers. RANDOMIZE should be called once *PER PAGE* only.
You are using ROUND where you should use INT. ROUND *could* give you a number that is one greater than the length of your string, so you would get an "out of bounds" error!
Finally, you set i=0 for no reason at all, since the very next line will throw away that value.
********************
SO:
Code:
CONST numSaltChars = 10
Randomize ' remember, once PER PAGE!
tmpString = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
sLen = Len(tmpString)
sSalt = ""
for i = 1 to numSaltChars
sSalt = sSalt & Mid( tmpString, 1 + INT(sLen * RND()), 1 )
next