Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Microsoft VBScript runtime error "800a005e".

Posted on 2007-03-26
7
Medium Priority
?
2,223 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 2000 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 53

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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Well hello again!  Glad to see you've made it this far without giving up.  In this, the fourth installment of my popular series, I'm going to cover functions and subroutines, what they are, and why they are useful.  Just in case you stumbled onto th…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

704 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