VBS Runtime error 800A000D - Type mismatch

Hello i have this code:

<%@ LANGUAGE="VBSCRIPT" %>

<%
Function RndStr(Length, UseChrs)
 If IsNull(UseChrs) OR (UseChrs = "") Then UseChrs = "0123456789abcdefghijklmnopqrstuvwxyz!@#$%^&*()_+=-"
 NewStr = ""
 Randomize(CByte(Left(Right(Time(),5),2)))
 For gpIndex = 1 To Length
  NewStr = NewStr & Mid(UseChrs, Int((Len(UseChrs)) * Rnd + 1), 1)
 Next
 RndStr = NewStr
End Function
%>

<HTML>
<HEAD>
<TITLE>Info</TITLE>
</HEAD>
<BODY  bgcolor="#FFFFFF">

<font face="Arial" color="#000000" size ="2">

<br>
<textarea rows="20" cols="200" STYLE="font-family: Arial; font-size: 12px; background-color: #E8E8E8; word-wrap: normal; overflow: auto;">


Cookie = "<%= RndStr(40,"0123456789abcdefghijklmnopqrstuvwxyz")%>"
Password = "<%= RndStr(40,"0123456789abcdefghijklmnopqrstuvwxyz")%>"

</textarea>

</font>

</BODY>
</HTML>

Open in new window


   But when I run i get this error "VBS Runtime error 800A000D - Type mismatch"
Any know why is not working or what is needed to change to make work?
Thank you
coerraceAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
What line is the error occurring?
0
coerraceAuthor Commented:
This area:

Cookie = "<%= RndStr(40,"0123456789abcdefghijklmnopqrstuvwxyz")%>"
Password = "<%= RndStr(40,"0123456789abcdefghijklmnopqrstuvwxyz")%>"

Open in new window

0
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
Try running the code directly (not through the function) that should give you a better sense where the error occurs
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

coerraceAuthor Commented:
I used this:

<%

 If IsNull(UseChrs) OR (UseChrs = "") Then UseChrs = "0123456789abcdefghijklmnopqrstuvwxyz!@#$%^&*()_+=-"
 NewStr = ""
 Randomize(CByte(Left(Right(Time(),5),2)))
 For gpIndex = 1 To Length
  NewStr = NewStr & Mid(UseChrs, Int((Len(UseChrs)) * Rnd + 1), 1)
 Next
 RndStr = NewStr
 CookieEncryptionKey = RndStr(40,"0123456789abcdefghijklmnopqrstuvwxyz")
 PasswordEncryptionKey = RndStr(40,"0123456789abcdefghijklmnopqrstuvwxyz")
 Response.write (CookieEncryptionKey)
Response.write ("pass" & PasswordEncryptionKey)


%>

Open in new window



   And now the error say:

Microsoft VBScript runtime error '800a000d'

Type mismatch: 'CByte'
0
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
Change cbyte to cdbl
0
coerraceAuthor Commented:
Not work but i solved adding this:


<% Session.LCID = 2057 %>

Open in new window

after

<%@ LANGUAGE="VBSCRIPT" %>

Open in new window


Is a problem of regional settings on the server but with that is solved thank you anyway
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
coerraceAuthor Commented:
Solved
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.