Solved

Microsoft VBScript runtime error "800a005e".

Posted on 2007-03-26
7
2,211 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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This is pretty cool.  The purpose of this VB Script is to help you document where JAR (Java ARchive) files and specifically java class files are located so that you can address issues seen with a client or that you can speak intelligently with a dev…
Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

759 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

24 Experts available now in Live!

Get 1:1 Help Now