Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EXECUTE METHOD NOT WORKING

Status
Not open for further replies.

gsc123

Programmer
Jan 24, 2008
197
why do I get the error below when using the execute method?

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.



str = CStr(Request.Form("sql"))
conntemp.Execute str,numAffected

 
then I get this why I use them

Error Type:
Microsoft VBScript compilation (0x800A0414)
Cannot use parentheses when calling a Sub
/pt/admin/index.asp, line 1091, column 34
conntemp.Execute (str,numAffected)
---------------------------------^
 
you want to execute sql then go to the sub? it's what it looks like (might be wrong tho)...

try:
Code:
str = cStr(request.form("sql"))
'of course, you do not need the IF statement here.
IF str <> "" THEN
  conntemp.Execute(str)
  numAffected
END IF

...snip...

SUB numAffected
  'code here
END SUB

________________________________
Top 10 reasons to procrastinate:
1)
 
not really bothered about a result back - just that it executes
 
still same error?

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
 
well, what is contained in [tt]str[/tt]?

sounds like it is empty or you are querying a columns with no criteria. such as [tt]... WHERE id = [/tt]

try [tt]response.write[/tt] the value of [tt]str[/tt] out. then copy/paste that into your database and query it manually.



________________________________
Top 10 reasons to procrastinate:
1)
 
UPDATE security SET security.password = "xerxer"
 
Found the problem - double quotes around the word "xerxer"

 
even if you are not bothered about a result of your update, you should check the result anyway as if the update fails in the DB for some reason, e.g. incorrect SQL, key constraint in the database etc, then the response will come back into your ASP.

If you don't catch those situations then you may have some odd working and corruption in the rest of your system as a result.

Greg Griffiths
Livelink Certified Developer & ECM Global Star Champion 2005 & 2006
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top