Solved

Microsoft VBScript runtime error "800a005e".

Posted on 2007-03-26
7
2,222 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

628 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