Weird replace error (SOLVED)
I have a Access database with field type=Memo.
When I show this field in the browser I use this:
<%
descr = rsVisitReport("Address")
descr = replace(descr, vbCrlf, "<BR>")
Response.Write descr
%>
This works fine with fields that contain data but it returns an error when the Address field is empty.
Microsoft VBScript runtime error '800a005e'
Invalid use of Null: 'replace'
/system/Page.asp, line (number)
So I tried this little code:
<%
if (not rsVisitReport("Address")="") then
descr = rsVisitReport("Address")
descr = replace(descr, vbCrlf, "<BR>")
Response.Write descr
end if
%>
This fixes the old problem and empty fileds are shown correctly but when the field isn't empty and the replace takes place, now give the error:
Microsoft VBScript runtime error '800a005e'
Invalid use of Null: 'replace'
/system/Page.asp, line (number)
I don't get it.