473,320 Members | 1,900 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Too Few Parameters. Expected 1 (rs.Open)

Hi everyone, I'm new here.
My problem: the parameters that appear after rs.open when oppening the SQL connection.

Microsoft OLE DB Provider for ODBC Drivers error '80040e10'
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
/misc/page.asp, line 135


Code

<%
Set Conn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("prot/data.mdb")
sql= "SELECT Gallery, Name, Comments, Date FROM tblComments WHERE Gallery = " & fname
rs.Open sql, Conn

Do While Not rs.eof
Response.Write "<table cellspacing=0 cellpadding=5 width=""100%""><tr>"
Response.Write "<td bgcolor=#EFEFEF><font face=arial size=2 color=#093173><b>" & rs("Name") & "</td>"
Response.Write "<td bgcolor=#EFEFEF><font face=arial size=2 color=#000000>(" & rs("Date") & ")</td>"
Response.Write "</tr><tr>"
Response.Write "<td colspan=2>" & rs("Comments") & "</td>"
Response.Write "</tr></table>"
rs.MoveNext
Loop

rs.Close
Set rs = Nothing
Set Conn = Nothing
%>

Line 135 is "rs.Open sql, Conn, 3,3"
On a different page I had this problem but then changed the parameters to "rs.Open sql, Conn, 1,3,1" and it worked fine.

Appreciate any help.
Aug 14 '07 #1
1 3514
ilearneditonline
130 Expert 100+
Hi everyone, I'm new here.
My problem: the parameters that appear after rs.open when oppening the SQL connection.

Microsoft OLE DB Provider for ODBC Drivers error '80040e10'
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
/misc/page.asp, line 135


Code

<%
Set Conn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("prot/data.mdb")
sql= "SELECT Gallery, Name, Comments, Date FROM tblComments WHERE Gallery = " & fname
rs.Open sql, Conn


Line 135 is "rs.Open sql, Conn, 3,3"
On a different page I had this problem but then changed the parameters to "rs.Open sql, Conn, 1,3,1" and it worked fine.

Appreciate any help.

I am not sure this makes any difference, as I never use Access for anything but cluttering up my pc.

Expand|Select|Wrap|Line Numbers
  1.  conn.Provider="Microsoft.Jet.OLEDB.4.0"
  2. conn.Open Server.MapPath("prot/data.mdb")
Aug 15 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Miranda | last post by:
Hello, could somebody please help me figure this error out. I'm at my wits end here. This is my connection & SQL statement: <%@Language="Javascript" %> <!--#include...
8
by: kbrad | last post by:
I am using the following code in asp to select some data from an access db. recSel is defined and set further up my webpage, as is rsUpdate User. I cannot work out how to get past this error...
7
by: Dee | last post by:
Running an AfterUpdate event procedure, I get the following error: "Too few parameters. Expected 1." My code is as follows: Private Sub DealerID_AfterUpdate() Dim db As DAO.Database
8
by: RC | last post by:
In my Access 2002 form, I have a combo box and on the AfterUpdate event I use DoCmd.RunSQL ("UPDATE .... to update records in a table. When it starts to run I get a message "You are about to...
1
by: bonnie.tangyn | last post by:
Hello all I get Too few parameters expected 2 error and "The MS Jet Database engine cannot find the input table or query "myTempTablename". Make sure it exists and that its name is spelled...
2
by: isaac2004 | last post by:
hi am getting this error about a wrong field name in my database and it all seems right to me <%@ Language=VBScript %> <% Option Explicit %> <!--#include file="DatabaseConnect.asp"-->...
4
by: Richard Hollenbeck | last post by:
I thought I was very specific in this SQL request. There is a form open with a selected record (and a corresponding "lngRecipeID" on that form. The table also has a field called "lngRecipeID". ...
1
by: Dale | last post by:
Access 2003 frt end attached to sql 2000 backend I am trying to check for an existing record but cannot get past this error, too few parameters, expected 2 I have verified that all fields...
1
by: javediq143 | last post by:
Hi all, I got one more prob in another ASP page linked to the earlier one. I've created an Access DB and created a query using Access Query wizard. The query is running fine in Access and it is...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.