Results 1 to 3 of 3

Thread: Weird replace error (SOLVED)

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2004
    Location
    Earth 4 now.
    Posts
    27

    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.
    Last edited by ShotokanTuning; Jul 15th, 2004 at 04:47 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width