Solved

Microsoft VBScript runtime error "800a005e".

Posted on 2007-03-26
7
2,220 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 52

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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

752 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