CFF KB - Carrz-Fox-Fire Promotions Knowledge Base

CFF KB is all about 1 thing: The Sharing of Knowledge and the Power we gain from it.
  • Breadrumbs:
  • Microsoft VBScript runtime error '800a005e' Invalid use of Null: 'Replace'

  • CFF Knowledge Base - Share With Facebook CFF Knowledge Base - Share on Twitter CFF Knowledge Base - Share on Reddit CFF Knowledge Base - Share on Digg It CFF Knowledge Base - Share on Stumble Upon It CFF Knowledge Base - Share on Delicious
    Share With Friends (Updated 6-8-2010)
  • Article ID:
    140
  • Date Created
    Saturday, June 25, 2011
  • Last Updated
    Saturday, June 25, 2011
  • This Article Has been Viewed
    3894 times
  • Short Desc
    Functions that are used with unused variables will cause the Invalid use of null 800a005e error. Make sure that all your Function wrapped variables are indeed being used, and if not, then create an IF Statement as demostrated here to conteract the error.
  • Details
    If you use a Function for a 2 or more Created Variable, but only have 1 variable in use of the page, you will receive the following error.

     
    Microsoft VBScript runtime error '800a005e'
    Invalid use of Null: 'Replace'
    /Replace.asp, line 51
  • Recreate Issue
    To recreate this issue.

    Scenario #1
    <%
    if getAdmin="About" or getAdmin="Info" then
    Set sqlAb = Server.CreateObject("ADODB.Command")
    sqlAb.ActiveConnection=objConn
    sqlAb.Prepared = true
    sqlAb.commandtext="Select SAbout, SInfo from SiteInfo"
    set rsAb = sqlAb.execute
    if not rsAb.eof then
    SAbout = Reverse(rsAb("SAbout"))
    SInfo = Reverse(rsAb("SInfo"))
    end if
    end if
    %>


    Ok, the Reverse Function used in the create of the above Variables, is used to Reverse
    Our SQL Projection script. Now, our page only consist of 1 Form Textarea field, but yet we have 2 Variables that are created for the pages "About" and "Info"
    The <textarea><%=SAbout%></textarea>

    Scenario #2
    If you are using a Function on an Empty record, you will also receive this error.
  • Resolve Issue
    To resolve this issue.

    Scenario #1
    OK, since we are looking at both pages "About" and "Info", we need to make sure that only one or the other is used when the right page is shown.

    <%
    if getAdmin="About" or getAdmin="Info" then
    Set sqlAb = Server.CreateObject("ADODB.Command")
    sqlAb.ActiveConnection=objConn
    sqlAb.Prepared = true
    sqlAb.commandtext="Select SAbout, SInfo from SiteInfo"
    set rsAb = sqlAb.execute
    if not rsAb.eof then
    if getAdmin="About" then
    SAbout = ReverseHelp(rsAb("SAbout"))
    elseif getAdmin="Info" then
    SInfo = ReverseHelp(rsAb("SInfo"))
    end if
    end if
    %>


    Now, in the above we have created an IF Statement, that will display the created Variables for each of our Pages.

    Scenario #2
    Make sure that your records that are using the Function have data stored in them.