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

Too few parameters error

Status
Not open for further replies.

MadJock

Programmer
May 25, 2001
318
GB
I have written some ASP code. A form prompts to have two text input boxes filled in and twhen the user resses 'Submit' they should be written to a database.

My code is as follows:

<%
response.write(&quot;reached code now&quot;)
response.write(&quot;Name &quot; & request.form(&quot;txtName&quot;))
response.write(&quot;Comment&quot; & request.form(&quot;txtComments&quot;))
if request.form(&quot;txtName&quot;) <> &quot;&quot; then
if request.form(&quot;txtComments&quot;) <> &quot;&quot; then
strSQL = &quot;INSERT INTO tblGuestBook (PostedBy, Comment) VALUES (&quot; & request.form(&quot;txtName&quot;) & &quot;,&quot; & request.form(&quot;txtComments&quot;) & &quot;);&quot;
set oRS = oConn.Execute(strSQL)
end if
end if
%>

I then get the following error:
Code:
Microsoft OLE DB Provider for ODBC Drivers error '80040e10' 

[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 2.

What I don't undertand is that as far as I am aware I am passing two parameters (the 2 values)

Any help much appreciated!
 
Sorry, ignore question - I've fixed it.

If anyone else finds this it is because each value in the value list must be surrounded by single quotes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top