Solved

Microsoft VBScript runtime error "800a005e".

Posted on 2007-03-26
7
2,215 Views
Last Modified: 2011-09-20
I am getting the following error in my ASP code:

Microsoft VBScript runtime error "800a005e".  
Invalid use of Null.
 /Hedgehunter/hedgehunter_search_results.asp, line 252

This is expected as I am using the function MonthName and Year on a Null value. However, whenever an expected error like is occurs, is there anyway of catching it (much like a Java Exception) so I can do something with it other than display to the user (on the web page).

I am looking for a possible solution other than wrapping the functions in an IF statement to check if the values are Null first. I have a very large ASP file and this would require thousands of lines being modified.

Not sure if anything is possible but any help and suggestions are much appreciated.

Many Thanks
0
Comment
Question by:inghfs
7 Comments
 
LVL 67

Accepted Solution

by:
sirbounty earned 500 total points
ID: 18791531
Use this at the start of the script:

On Error Resume Next

Then to properly trap it, you'll need to find out the error number, then use something like

If err.Number=12345 Then 'your expected error has occurred - react to it or simply continue to ignore it (in which case this line can be removed)
0
 
LVL 18

Expert Comment

by:mgfranz
ID: 18791651
Not sure of your question, you want your code to fix itself without modifying it?  The error will not go away without correcting the problem,
0
 
LVL 49

Expert Comment

by:Ryan Chong
ID: 18791712
Agree with mgfranz, I prefer a "Find and Replace" method, where hopefully you only need correct your scripts once.

>>Invalid use of Null.
try check line 252 on /Hedgehunter/hedgehunter_search_results.asp and probably you can post it here.

typically you can have a quick fix by adding an empty string in front of the value you refer to, like:

a = yourfunction("" & b)

instead of

a = yourfunction(b)


hope this helps
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 67

Expert Comment

by:sirbounty
ID: 18791862
Happy to help - thanx for the grade! :^)
0
 

Author Comment

by:inghfs
ID: 18791864
sirbounty - How would I find the error number.? I also want to get access to the error message as a variable to include it in a HTML mailto. Is this possbile?
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18791870
With
On Error Resume Next
added,

enter the following on the line after where your error was occuring:

msgbox err.Number

Then you can use that number to compare:

If err.Number=12345 Then
 'do something
End If
On Error Goto 0 'reset error

err.Description would be useful in your mail...
0
 

Author Comment

by:inghfs
ID: 18792054
Excellent, Many Thanks!!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now