HTTP 500.100 - Internal Server Error - ASP error
Error Type:
Microsoft VBScript compilation (0x800A0414)
Cannot use parentheses when calling a Sub
/*********.asp, line ***, column 37
addsubcat(rsCat("cat_id"), strSpaces)
------------------------------------^
That is the error message that I get when I try to execute this function:
<%
Function addsubcat(parentID, strSpaces)
sql = "SELECT * FROM categories WHERE cat_parent = " & parentID & ";"
Set rsCat = Server.Createobject("ADODB.Recodset")
rsCat.open sql, ado
WHILE NOT rsCat.EOF
strNewSpaces = strSpaces & " "
Response.Write("<option value=" & rsCat("cat_id") & ">" & strNewSpaces & rsCat("cat_name") & "</option>")
addsubcat(rsCat("cat_id"), strNewSpaces)
rsCat.MoveNext
WEND
rsCat.close
Set rsCat = Nothing
End Function
%>
The error occurs every time I try to execute that function with more than one parameter. If I delete one of the paremeters from the function header and don't send it when calling it, the error doesn't appear. But I really need the second parameter.
I'm writing this new topic because I started this one but it's too confusing for a rather simpler problem.
Thanks in advance for any help!