Microsoft VBScript runtime error '800a01f5'  Illegal assignment

Posted on 2006-03-28
Last Modified: 2008-01-09
This page is supposed to add a new category to a table in my database.  When I submit the form to add the new category I get the following error:

Microsoft VBScript runtime error '800a01f5'

Illegal assignment: 'doSaveEditCat'

/catFuncs.asp, line 76
Despite this the category is successfully added to the database.  Can anyone tell me why I get this error?  I have included the referenced code below:

'--Function:  Add a new category
function doSaveAddNewCat(catname, parent)
      Dim sqltext
      Dim retVal
      if (len(parent) = 0) Then
            parent = 0
      end if
      sqltext = "INSERT INTO tblCategoryNew (Category, Parent) VALUES ('" & dbSafeString(catname) & "'," & parent & ")"

      retVal = doDBWrite(sqltext)
      writeLogEntry "Add New", "Directory Category", now, dbSafeString(catname), session("User_FirstName") & " " & session("User_Lastname"), sqltext
      doSaveEditCat = retVal
end function

Also, when I try to delete categories I get a "page can not be found" page and the category does not get deleted.  I don't know if these two issue are related, but the following code may help with the second problem:

'--Function:  Delete a category
function doDeleteCat(catID)
      Dim retVal
      Dim lrecords
      Dim sqltext
      Dim parent
      retVal = ""
      parent = getParentID(catID)
      sqltext = "DELETE FROM tblCategoryNew WHERE CategoryID = " & catID
      if (checkAccess(0,ADMIN) = 1) Then
            on error resume next
            lRecords = 0
            conData.execute sqlText,lRecords      
            if (err.number <> 0) Then
                  retVal = sqltext
                  sqltext = "DELETE FROM tblCategoryNew WHERE Parent = " & temp
                  lRecords = 0
                  conData.execute sqlText,lRecords      
            end if
      end if

      writeLogEntry "Delete", "Directory Category", now, getCatName(catID), session("User_FirstName") & " " & session("User_Lastname"), sqltext
      doDeleteCat = retVal
end function

I welcome and and all suggestions!  Thanks.
Question by:blob150
    1 Comment
    LVL 1

    Accepted Solution

    The first problem is in your function called doSaveAddNewCat. The last line of your function reads:

    doSaveEditCat = retVal

    It should read:

    doSaveAddNewCat = retVal

    That will fix that issue.  As for the other one....

    The error "Page cannot be found" doesn't seem to have anything to do with the function since you are not redirecting or anything.  I can't tell on that one.


    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
    Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now