blob150
asked on
Microsoft VBScript runtime error '800a01f5' Illegal assignment
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
else
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.
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
else
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.