Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

classic ASP error '80020009' Exception occurred

On line 5 of the code to a site I am fixing, I get an exception error from classic ASP. The ** line below is line 5. It looks like this function is used on other pages in the site, although I'm not quite sure why. I've tried just removing the code, but since it's used other places, it must be important, so maybe I shouldn't try removing it....

Private Function AE(myString)
**If myString <> "" then** 
AE = Replace(myString,"`","'")
End If
End Function

Here is an example of where AE is used: response.write AE(rs("ArticleTitle"))

Thanks in advance for any help you can give me!

like image 566
Jamie Avatar asked Feb 14 '13 17:02

Jamie


2 Answers

This probably means that the field in the database is Null. You could add this line before the problematic line:

If isNull( myString ) Then Exit Function

In case that doesn't work, you could also try changing the problematic line into this:

If "" & myString <> "" Then
like image 122
Sander_P Avatar answered Sep 25 '22 01:09

Sander_P


This error also comes up if you try to access a record in a recordset which has no records (ie if you forgot to check for eof before accessing the fields).

like image 32
mike nelson Avatar answered Sep 26 '22 01:09

mike nelson