Tutorials
Invalid use of null
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:
VBScript
< %
Dim myVar
myVar = (rsName.Fields.Item("MemoColumn").Value)
If myVar <> "" Then
Replace(myVar,chr(13),"</p><p>")
End If
%>
Notes
- 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.
If you are doing this in a repeat region, don't include the Dim statement at this point in your script - either put it at the top of the page or at least, somewhere outside of the repeat region or you will get an error.
© Copyright 2008 - robgt.com

