Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
Microsoft VBScript runtime error '800a0005'
Old 08-23-2006, 12:35 PM Microsoft VBScript runtime error '800a0005'
Novice Talker

Posts: 7
Name: Karl
Trades: 0
What do I have to change in this code for this to work?

<%
Dim varPassword, varCharacter ' Strings
Dim varContainsANumber ' Boolean
Dim i ' Integer
varPassword = Request.Form("password")
varContainsANumber = False
If varPassword <> "" And Not IsNull(varPassword) Then
' Password was entered - check length
If Len(varPassword) >= 6 Then
' Password is 6 characters or longer
' Check that at least one number is present
' Loop through string and test each character to see if it is numeric
i = 1
While i < Len(varPassword)
varCharacter = mid(varPassword, i, 1)
If IsNumeric(varCharacter) Then
' Number found, set flag to true
varContainsANumber = True
End If
i = i + 1
Wend

If varContainsANumber Then
' Password has passed criteria checks... do stuff...
Else
' Password failed criteria checks
' Return an appropriate error message to the user
End If
Else
' Password is shorter than 6 characters
' Return an appropriate error message to the user
End If
Else
' Password was not entered
' Slap user with a large fish
End If
%>


Any ideas appreciated

Thanks in advance

Karl.
TheBOSMan is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-23-2006, 12:45 PM Re: Microsoft VBScript runtime error '800a0005'
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
what is it NOT doing ??
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-23-2006, 12:48 PM Re: Microsoft VBScript runtime error '800a0005'
Novice Talker

Posts: 7
Name: Karl
Trades: 0
Quote:
Originally Posted by chrishirst View Post
what is it NOT doing ??
When the user enters there password and submits, the error in the title is displayed.
TheBOSMan is offline
Reply With Quote
View Public Profile
 
Old 08-23-2006, 01:00 PM Re: Microsoft VBScript runtime error '800a0005'
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
and the rest of the error message is ???
otherwise it would simply be a guess at which procedure caused the "invalid procedure error"
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-23-2006, 01:04 PM Re: Microsoft VBScript runtime error '800a0005'
Novice Talker

Posts: 7
Name: Karl
Trades: 0
sorry.



Microsoft VBScript runtime error '800a0005'
Invalid procedure call or argument: 'Mid' /ChangePassword.asp, line 91
TheBOSMan is offline
Reply With Quote
View Public Profile
 
Old 08-23-2006, 01:05 PM Re: Microsoft VBScript runtime error '800a0005'
Novice Talker

Posts: 7
Name: Karl
Trades: 0
which is line "varCharacter = mid(varPassword, i, 1)"
TheBOSMan is offline
Reply With Quote
View Public Profile
 
Old 08-23-2006, 02:52 PM Re: Microsoft VBScript runtime error '800a0005'
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
in that case the usual cause would be a variable outside the allowed value

so either the loop value (i) is out of range or the password is empty.

have you debugged by printing the values to screen before the error occurs?

Why do you use a while/wend loop for something so basic BTW?

for i = 0 to len(varPassword)
' run check here
next

would accomplish what you want

or a simple regex would check the input at one call

Code:
<%
function CheckNumeric(strIn)
' function to validate numeric input
	dim objRE
	set objRE = New RegExp
	objRE.Pattern = "[0-9]"
	objRE.Global = True
	CheckNumeric = objRE.test(strIn)
	set regEx = nothing
end function
%>
Will return true if strIn contains a number false if not
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-23-2006, 03:36 PM Re: Microsoft VBScript runtime error '800a0005'
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
Looks like you're missing an End If statement.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 08-24-2006, 08:52 AM Re: Microsoft VBScript runtime error '800a0005'
saadatshah's Avatar
Extreme Talker

Posts: 215
Name: Syed Saadat Ali
Location: Lahore, Pakistan
Trades: 0
use of RegularExpression is optimized instead of loops
__________________
- -- --- ---- ----- ------ ------- ---------------
If you have knowledge, let others light their candles in it.
saadatshah is offline
Reply With Quote
View Public Profile Visit saadatshah's homepage!
 
Reply     « Reply to Microsoft VBScript runtime error '800a0005'
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.41361 seconds with 12 queries