473,320 Members | 1,949 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.

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

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 file="../../admin/adojavas.inc"-->

<%
var conn;
var rs;
var sSQL;

conn = Server.CreateObject("ADODB.connection");
conn.Open("cpWebdata");

sSQL = "SELECT InvestorId.Investors, MemberID.Investors ";
sSQL += " FROM Investors ";
sSQL += " WHERE InvestorId= '" + Request.Form("clientName") + "' ";
sSQL += " AND MemberID = '" + Request.Form("clientPass") + "' ";
THIS IS LINE 18 - > rs.Open(sSQL,conn);

Response.write(sSQL);

rs.close();
conn.close();
rs=null;
conn=null;

%>

And this is the error I am getting:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected
2.
line 18.

The data it is checking is numeric, so I am wondering if there is an
issue with my quotes in my SQL statement?

Just in case it helps, here is the form:

<form name="f1" action="authorizeClienttest.asp" method="post"
onSubmit="return verify(f1);">

Client Login
Name:<input name="clientName" type="text" size="10" maxlength="10">
Password:<input name="clientPass" type="text" size="10"
maxlength="10">

<a href="#"><input type="image" src="images/loginSubmit.gif"
width="38" height="17" border="0" alt="Log In"></a>
</form>

Any help with this would be gratefully appreciated :)
Thanks in advance,
Cheers,
Miranda Johnsen
www.mirandajohnsen.com

************************************************** ****************
DEEP THOUGHTS...
"Every worthwhile accomplishment, big or little, has its stages of
drudgery and triumph; a beginning, a struggle and a victory."
Ghandi
************************************************** ******************
Jul 19 '05 #1
6 20972
It seems to me that you're mixing up your column and table names.

Try:
sSQL = "SELECT Investors.InvestorId, Investors.MemberID";
sSQL += " FROM Investors ";
sSQL += " WHERE InvestorId= '" + Request.Form("clientName") + "' ";
sSQL += " AND MemberID = '" + Request.Form("clientPass") + "' ";

Or just drop the Investors. part altogether since you're only querying one
table.

Also, if these values are numeric in your database, you don't want to
delimit them with '.

Ray at work

"Miranda" <Mi*************@hotmail.com> wrote in message
news:5c**************************@posting.google.c om...
sSQL = "SELECT InvestorId.Investors, MemberID.Investors ";
sSQL += " FROM Investors ";
sSQL += " WHERE InvestorId= '" + Request.Form("clientName") + "' ";
sSQL += " AND MemberID = '" + Request.Form("clientPass") + "' ";
THIS IS LINE 18 - > rs.Open(sSQL,conn);

Response.write(sSQL);

Jul 19 '05 #2
Miranda wrote:
Hello, could somebody please help me figure this error out. I'm at my
wits end here. This is my connection & SQL statement:
Actually, you did not show us your SQL statement. You showed us some
vbscript code that hopefully will result in a valid sql statement.

<snip> sSQL = "SELECT InvestorId.Investors, MemberID.Investors ";
sSQL += " FROM Investors ";
sSQL += " WHERE InvestorId= '" + Request.Form("clientName") + "' ";
sSQL += " AND MemberID = '" + Request.Form("clientPass") + "' ";
THIS IS LINE 18 - > rs.Open(sSQL,conn);

Response.write(sSQL);

Please show us the result of this statement. Comment out line 18 if you
have to. Actually look at it yourself and make sure it's a valid sql
statement that will run without modification when pasted into the
SQL View of the Access Query Builder.

I suggest you use & instead of + for your string concatenation operator.

Bob Barrows
PS. You should not be using ODBC. There is a perfectly fine native OLEDB
provider for Jet. See here for examples of connection strings using the Jet
OLEDB provider.
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 19 '05 #3
> PS. You should not be using ODBC. There is a perfectly fine native OLEDB
provider for Jet. See here for examples of connection strings using the Jet OLEDB provider.


http://www.connectionstrings.com/
http://www.aspfaq.com/2126
Jul 19 '05 #4
In defense of Bob, he must have been in a rush, or he certainly would have
noticed that you're using jscript. Don't yell at him!

Ray at work

"Bob Barrows" <re******@NOyahoo.SPAMcom> wrote in message
news:ei**************@TK2MSFTNGP11.phx.gbl...

Actually, you did not show us your SQL statement. You showed us some
vbscript code that hopefully will result in a valid sql statement.

Jul 19 '05 #5
One thing I noticed is that you declare var rs, but you don't open a
Recordset such as: rs=Server.CreateObject("ADODB.Recordset")

"Miranda" <Mi*************@hotmail.com> wrote in message
news:5c**************************@posting.google.c om...
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 file="../../admin/adojavas.inc"-->

<%
var conn;
var rs;
var sSQL;

conn = Server.CreateObject("ADODB.connection");
conn.Open("cpWebdata");

sSQL = "SELECT InvestorId.Investors, MemberID.Investors ";
sSQL += " FROM Investors ";
sSQL += " WHERE InvestorId= '" + Request.Form("clientName") + "' ";
sSQL += " AND MemberID = '" + Request.Form("clientPass") + "' ";
THIS IS LINE 18 - > rs.Open(sSQL,conn);

Response.write(sSQL);

rs.close();
conn.close();
rs=null;
conn=null;

%>

And this is the error I am getting:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected
2.
line 18.

The data it is checking is numeric, so I am wondering if there is an
issue with my quotes in my SQL statement?

Just in case it helps, here is the form:

<form name="f1" action="authorizeClienttest.asp" method="post"
onSubmit="return verify(f1);">

Client Login
Name:<input name="clientName" type="text" size="10" maxlength="10">
Password:<input name="clientPass" type="text" size="10"
maxlength="10">

<a href="#"><input type="image" src="images/loginSubmit.gif"
width="38" height="17" border="0" alt="Log In"></a>
</form>

Any help with this would be gratefully appreciated :)
Thanks in advance,
Cheers,
Miranda Johnsen
www.mirandajohnsen.com

************************************************** ****************
DEEP THOUGHTS...
"Every worthwhile accomplishment, big or little, has its stages of
drudgery and triumph; a beginning, a struggle and a victory."
Ghandi
************************************************** ******************

Jul 19 '05 #6
Ray at <%=sLocation%> wrote:
In defense of Bob, he must have been in a rush, or he certainly would
have noticed that you're using jscript. Don't yell at him!

oops!

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: dcarson | last post by:
I've read about this error in several other discussions, but still can't seem to pinpoint the problem with my code. Everything seemed to be working fine for some time, but it now tends to bomb out...
0
by: Ian | last post by:
Hello, I'm getting this error when I try and updat two tales from the same web form. Does anyone know what might be cuasing the conflict in the database? Cheers Ian
1
by: Reza Nabi | last post by:
Dear All: I have been developing ASP.NET application on MS Access database using ODBC. When I was trying to save more than 255 chars in a Memo field I got the following error. ERROR Invalid...
0
by: jwtulp | last post by:
Hello all, I receive the following error when updating MSAccess2003 Memo fields using an ODBC connection in ASP.Net 1.1 when the length of the text to be updated exceeds 255 characters....
5
by: somersbar | last post by:
hello all, im trying to connect to a microsoft access database from an ASP.NET web form. i keep getting the following error though: ERROR Could not use '(unknown)'; file already in use....
0
by: bazzer | last post by:
hey, i am using visual basic.net 2003 and have an ASP.NET webform application thats accessing a microsoft access 2003 database. i kept getting the following error when i tried to run it: ERROR ...
0
by: bazzer | last post by:
hey, im trying to access a microsoft access database from an ASP.NET web application in visual basic 2003.NET. i get the following error when i try running it: Server Error in...
0
by: jazz1 | last post by:
my coding is <% //Connection conn=null; //Statement st=null; //ResultSet rs=null; int msgCount; try { String userid=request.getParameter("application_no");
2
by: steve waugh | last post by:
Hi All I've an ASP application running on MS-Access Data Base. from the last few weeks i'm getting the error, Microsoft] Not enough space on temporary disk. when ever this error comes,...
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...
1
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...
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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.