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

ODBC 37000

Status
Not open for further replies.

TheDoubleB

Programmer
Jan 29, 2001
18
0
0
US
This is a simple update that is giving me problems.
<CFQUERY name=&quot;UpdateNotes&quot; dbtype=&quot;ODBC&quot; datasource=&quot;Notebook&quot;>
Update Notes
Set
ContactPerson=&quot;#Form.Person#&quot;,
ContactPhone=&quot;#Form.Phone#&quot;,
Notes=&quot;#Form.Note#&quot;
Where
ID='#NR#'
</CFQUERY>

I use a MAX() query on the previous page to get the #NR# and then pass it to this cfm with submit.cfm?NR=#NR#.

If I use
<CFOUTPUT>
'#NR#'
</CFOUTPUT>

Is shows F1B6A550-547F-11D5-B2B0-00010270293C, which is the ID I want to update. The ID is an Autonumber field.

I've tried it with single quotes, double quotes, no quotes, same error. Any ideas?


 
Guess I should include the error.
ODBC Error Code = 07001 (Wrong number of parameters)
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 4.
 
Should you possibly call it '#URL.NR#'? If I understand you correctly, the query in on the page you passed the variable to. Good luck! Calista :-X
Jedi Knight,
Champion of the Force
 
Hey DoubleB,

According to what you describe, this should work for you.

<CFQUERY name=&quot;UpdateNotes&quot; datasource=&quot;Notebook&quot;>
Update Notes Set
ContactPerson='#Form.Person#',
ContactPhone='#Form.Phone#',
Notes='#Form.Note#'
Where ID=#url.NR#
</CFQUERY>

You need single quotes around any text field and no quotes around any numeric, date, or autonumber fields. I've never seen MS Access generate an autonumber value though which looked like the string you posted. How many records do you have in your db?

Hope this helps,
GJ
 
I believe in an update statement with an auto number involved you need to soecify the fields to update. It is looking for 4 so try something like this to your UPDATE Statement

UPDATE Notes(Person, Phone, Note)

I am sure there is more needed in the () I had this same problem and can email you more info tomorrow
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top