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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple update - Too few parameters

Status
Not open for further replies.

mrkipling

Technical User
Apr 26, 2001
16
GB
I'm trying to put togeather a multiple update statement

using the following code:

Insert_vehicle.CommandText = "UPDATE tbl_bmw_ks_imagestatus SET tbl_bmw_ks_imagestatus.ks_notes = '" + Replace(Insert_vehicle__varnotes, "'", "''") + "' WHERE request_ID = " + Replace(Insert_vehicle__varID, "'", "''") + ""

but getting the following error:

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

is my syntax wrong or is it somthing else im missing.

TIA.

Mark
 
This error normally occurs when access doesn't recognize one of your field names so it assumes it is a parameter. This can be because a field name is mis-spelled, but in this case it is because you forgot to include quotes around the request_ID value. Try:
Code:
Insert_vehicle.CommandText = "UPDATE tbl_bmw_ks_imagestatus SET tbl_bmw_ks_imagestatus.ks_notes = '" + Replace(Insert_vehicle__varnotes, "'", "''") + "' WHERE request_ID = [b][blue]'[/blue][/b]" + Replace(Insert_vehicle__varID, "'", "''") + "[b][blue]'[/blue][/b]"
 
thanks ddiamond, thats exactly what it was, I had copy&pasted the code and forgotten to change the field name.

Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top