KB Issue
When writing out parameterized queries, you may receive the following "Wrong number of arguments or invalid property assignment."
Issue Details
The following error will happen during runtime when you have an error in your Classic ASP code when writing out your Parameterized Queries.
Microsoft VBScript runtime error '800a01c2'
Wrong number of arguments or invalid property assignment: 'sql.commandtext'
/Header.asp, line 161
Recreate Issue
The following code will cause the Wrong number of arguments
Copy
Search Site
Search Google
error.
Code Example
sqlgetLM.commandtext "SELECT TOP colOne FROM TableOne"

In the above line, we are missing an important object.
Resolve Issue
The proper way to write out the above Query Statement without error is.
Code Example
sqlgetLM.commandtext = "SELECT TOP colOne FROM TableOne"

Adding the = (equal) sign between the commandtext and the Select Statement is the correct way to write out the above command.