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!

Select Query works but not Update

Status
Not open for further replies.

TheDoubleB

Programmer
Jan 29, 2001
18
0
0
US
I am using the following codes:

<CFQUERY name=&quot;SNNote&quot; dbtype=&quot;ODBC&quot; datasource=&quot;Afr&quot;>
Select * from Notes
Where
SNID =#NR#
</CFQUERY>

This works and I can display the data. However, when I try an update with:

<CFQUERY name=&quot;SNUpdNote&quot; dbtype=&quot;ODBC&quot; datasource=&quot;Afr&quot;>
Update Notes
Set
FirmName=&quot;#Form.Firm#&quot;,
ContactPerson=&quot;#Form.Person#&quot;,
ContactPhone=&quot;#Form.Phone#&quot;,
Notes=&quot;#Form.Note#&quot;
Where
SNID =#NR#
</CFQUERY>

and I get:

ODBC Error Code = 07001 (Wrong number of parameters)
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 3.

Anyone have any ideas? This is driving me nuts....

 
Never mind....must have been temporarily brain-dead...just changed the double quotes to single quotes....
 
Thanks, Calista,

No offense taken. But, yes, I output the data I want to insert right before outputting the &quot;supposedly&quot; updated query.

One thing I did change was instead of <cfoutput query=&quot;newdata&quot;>, I now say <cfloop query=&quot;newdata&quot;> and I get the same results. No updated query.

So frustrated....

Thanks for your help, though.
scripter73


Change Your Thinking, Change Your Life.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top