Skip to main content
Participating Frequently
October 14, 2008
Question

simple ques--action page

  • October 14, 2008
  • 2 replies
  • 396 views
I am trying to insert records into an Access document but when trying to execute the action page I get the following:


Error Executing Database Query.
[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.

The error occurred in C:\ColdFusion8\wwwroot\ASK\AskAction.cfm: line 17

15 :
16 :
17 : values ('#trim(form.qname)#', '#trim(form.email)#', #DateVariable2#, #Val(form.Mathques)#, '#(form.quest)#')
18 :
19 : </cfquery>



--------------------------------------------------------------------------------

SQLSTATE 07002
SQL insert into table1 (qname, email,qdate,recipient,question) values ('bill', 'bill2@yahoo.com', 13-Oct-08, 0, '45x9 ')
VENDORERRORCODE -3010
DATASOURCE ques

Resources:
Check the ColdFusion documentation to verify that you are using the correct syntax.
Search the Knowledge Base to find a solution to your problem.


Browser Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.04506; InfoPath.2)
Remote Address 0:0:0:0:0:0:0:1
Referrer http://localhost:8500/ask/ASKform.cfm
Date/Time 13-Oct-08 09:07 PM

Stack Trace (click to expand)


thanks,
Steve
This topic has been closed for replies.

2 replies

Inspiring
October 14, 2008
By looking at the error output and the sql generated you have a couple of problems.

1. Some column names are reserved words (eg. email)
2. The date value may be causing a problem
3. You have brackets in the last column output

You can fix the reserved word problem by changing the column names or the example below should work as well

insert into table1 (qname, [email],qdate,[recipient],[question])
values ('#trim(form.qname)#', '#trim(form.email)#', #createODBCDate(DateVariable2)#, #Val(form.Mathques)#, '#form.quest#')

Ken
Known Participant
October 14, 2008
17 : values ('#trim(form.qname)#', '#trim(form.email)#', #DateVariable2#, #Val(form.Mathques)#, '#(form.quest)#')

Check your brackets, position of #s and also check that you are getting values in your variables (<cfdump var = "form">

Michael