Knowledgebase

Home / Help Central / Knowledgebase

Error: Microsoft VBScript runtime error '800a005e' Invalid use of Null: 'Replace'

Error:
Microsoft VBScript runtime error '800a005e'
Invalid use of Null: 'Replace'
 
Solution:
This error occurs when you have used a Replace function on your page, for instance, to maintain line breaks from a Memo field, and the particular field your recordset has returned is empty (Null).
You can get around this problem by modifying your code slightly to test the field for a value before the replace code runs.
 
For example,
Add this code to each line where you want the memo field to show line breaks:

< %
myVar = (rsName.Fields.Item("MemoColumn").Value)
If myVar <> "" Then
Replace(myVar,chr(13),"br")
End If
%>
  • The variable, myVar, can be named whatever you like.
  • rsName is the name of your recordset.
  • MemoColumn is the name of the column in your database that contains the memo field.