473,668 Members | 2,633 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Too few parameters. Expected 1. - Problem with asp/access

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 message
Too few parameters. Expected 1.
Can anyone see the problem?
strSQL = "SELECT tblUserDetails. UserRecId, tblUserDetails. UserName, " _
& "tblUserDetails .UserPw, tblUserDetails. UserEmailAddres s, " _
& "tblUserDetails .UserFirstName, tblUserDetails. UserSurname, " _
& "tblUserDetails .UserPhoneNo, tblUserDetails. UserCompany " _
& "FROM tblUserDetails" _
& " WHERE tblUserDetails. UserName =" & recSel

rsUpdateUser.Op en strSQL, adoCon, adOpenDynamic, adLockOptimisti c
Jul 19 '05 #1
8 1914
Try and write the strSQL to screen and check it's output, then try nd run
this through your db tool (like access) as a query. This process might point
you in the direction of the problem (Like a field doesn't exist, or is of
the wrong type). As we can't see your db and it's contents it's tough to
tell you, the code itself looks pretty good.

Let us know how you get on.

Stu

"kbrad" <kb***@discussi ons.microsoft.c om> wrote in message
news:BD******** *************** ***********@mic rosoft.com...
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 message
Too few parameters. Expected 1.
Can anyone see the problem?
strSQL = "SELECT tblUserDetails. UserRecId, tblUserDetails. UserName, " _
& "tblUserDetails .UserPw, tblUserDetails. UserEmailAddres s, " _
& "tblUserDetails .UserFirstName, tblUserDetails. UserSurname, " _
& "tblUserDetails .UserPhoneNo, tblUserDetails. UserCompany " _
& "FROM tblUserDetails" _
& " WHERE tblUserDetails. UserName =" & recSel

rsUpdateUser.Op en strSQL, adoCon, adOpenDynamic, adLockOptimisti c

Jul 19 '05 #2
kbrad wrote:
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 message
Too few parameters. Expected 1.
This always means that a word exists in the query where a field or table
reference should be.
Can anyone see the problem?
strSQL = "SELECT tblUserDetails. UserRecId, tblUserDetails. UserName, "
_ & "tblUserDetails .UserPw, tblUserDetails. UserEmailAddres s, " _
& "tblUserDetails .UserFirstName, tblUserDetails. UserSurname, " _
& "tblUserDetails .UserPhoneNo, tblUserDetails. UserCompany " _
& "FROM tblUserDetails" _
& " WHERE tblUserDetails. UserName =" & recSel


You cannot debug this without knowing what the actual sql statement is. The
only way to determine that is to response.write it. Show us the result of

Response.Write strSQL

UserName is probably a character (Text) field so you need to concatenate
delimiters around the filter value:

& " WHERE tblUserDetails. UserName ='" & recSel & "'"

Here are some previous posts I've made dealing with delimiters (and how to
avoid dealing with them):
http://www.google.com/groups?hl=en&l...TNGP12.phx.gbl
http://tinyurl.com/jyy0
http://www.google.com/groups?hl=en&l...%3D10%26sa%3DN
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 19 '05 #3
Brilliant - so simple when you know how!!

I have another problem, now I'm getting this
Microsoft VBScript runtime error '800a000d'

Type mismatch: 'rsUserUpdate'
It related to this line of code which tries to put a value from the
recordset into a form.
<td><input name="firstname " type="text" maxlength="200" VALUE="<%
response.write rsUserUpdate("U serFirstName") %>"> </td>

Any ideas would be very welcome.
"Bob Barrows [MVP]" wrote:
kbrad wrote:
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 message
Too few parameters. Expected 1.


This always means that a word exists in the query where a field or table
reference should be.
Can anyone see the problem?
strSQL = "SELECT tblUserDetails. UserRecId, tblUserDetails. UserName, "
_ & "tblUserDetails .UserPw, tblUserDetails. UserEmailAddres s, " _
& "tblUserDetails .UserFirstName, tblUserDetails. UserSurname, " _
& "tblUserDetails .UserPhoneNo, tblUserDetails. UserCompany " _
& "FROM tblUserDetails" _
& " WHERE tblUserDetails. UserName =" & recSel


You cannot debug this without knowing what the actual sql statement is. The
only way to determine that is to response.write it. Show us the result of

Response.Write strSQL

UserName is probably a character (Text) field so you need to concatenate
delimiters around the filter value:

& " WHERE tblUserDetails. UserName ='" & recSel & "'"

Here are some previous posts I've made dealing with delimiters (and how to
avoid dealing with them):
http://www.google.com/groups?hl=en&l...TNGP12.phx.gbl
http://tinyurl.com/jyy0
http://www.google.com/groups?hl=en&l...%3D10%26sa%3DN
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Jul 19 '05 #4
It probably contains Null. Do this:

response.write rsUserUpdate("U serFirstName") & ""

Bob Barrows
kbrad wrote:
I have another problem, now I'm getting this
Microsoft VBScript runtime error '800a000d'

Type mismatch: 'rsUserUpdate'
It related to this line of code which tries to put a value from the
recordset into a form.
<td><input name="firstname " type="text" maxlength="200" VALUE="<%
response.write rsUserUpdate("U serFirstName") %>"> </td>


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 19 '05 #5
I don't understand this can you explain what the &"" is for?
I've tried it and get the same error.

"Bob Barrows [MVP]" wrote:
It probably contains Null. Do this:

response.write rsUserUpdate("U serFirstName") & ""

Bob Barrows
kbrad wrote:
I have another problem, now I'm getting this
Microsoft VBScript runtime error '800a000d'

Type mismatch: 'rsUserUpdate'
It related to this line of code which tries to put a value from the
recordset into a form.
<td><input name="firstname " type="text" maxlength="200" VALUE="<%
response.write rsUserUpdate("U serFirstName") %>"> </td>


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Jul 19 '05 #6
It's to append an empty string to the Null that was supposedly contained in
the recordset field, which I guess is not the case since you are still
getting the error. Without knowing what's in your recordset i really can't
help. Try looping through your recordset fields with this code to see if you
can see the problem:

for each fld in rsUserUpdate.Fi elds
Response.Write fld.Name & ": """ & fld.value & """<BR>"
next

Bob Barrows
kbrad wrote:
I don't understand this can you explain what the &"" is for?
I've tried it and get the same error.

"Bob Barrows [MVP]" wrote:
It probably contains Null. Do this:

response.write rsUserUpdate("U serFirstName") & ""

Bob Barrows
kbrad wrote:
I have another problem, now I'm getting this
Microsoft VBScript runtime error '800a000d'

Type mismatch: 'rsUserUpdate'
It related to this line of code which tries to put a value from the
recordset into a form.
<td><input name="firstname " type="text" maxlength="200" VALUE="<%
response.write rsUserUpdate("U serFirstName") %>"> </td>


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get
a quicker response by posting to the newsgroup.


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 19 '05 #7
Oh stupid me!!! It should be rsUpdateUser not rsUserUpdate -problem solved.
Thanks for you help with this and the original problem. Greatly appreciated.

"Bob Barrows [MVP]" wrote:
It's to append an empty string to the Null that was supposedly contained in
the recordset field, which I guess is not the case since you are still
getting the error. Without knowing what's in your recordset i really can't
help. Try looping through your recordset fields with this code to see if you
can see the problem:

for each fld in rsUserUpdate.Fi elds
Response.Write fld.Name & ": """ & fld.value & """<BR>"
next

Bob Barrows
kbrad wrote:
I don't understand this can you explain what the &"" is for?
I've tried it and get the same error.

"Bob Barrows [MVP]" wrote:
It probably contains Null. Do this:

response.write rsUserUpdate("U serFirstName") & ""

Bob Barrows
kbrad wrote:
I have another problem, now I'm getting this
Microsoft VBScript runtime error '800a000d'

Type mismatch: 'rsUserUpdate'
It related to this line of code which tries to put a value from the
recordset into a form.
<td><input name="firstname " type="text" maxlength="200" VALUE="<%
response.write rsUserUpdate("U serFirstName") %>"> </td>
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get
a quicker response by posting to the newsgroup.


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Jul 19 '05 #8
> Oh stupid me!!! It should be rsUpdateUser not rsUserUpdate -problem
solved.

Why not just call it rs? Eliminates this problem...

--
http://www.aspfaq.com/
(Reverse address to reply.)
Jul 19 '05 #9

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

Similar topics

2
6718
by: Robert Mark Bram | last post by:
Hi All! My ASP page below receives the following error: Error Type: Microsoft OLE DB Provider for ODBC Drivers (0x80040E10) Too few parameters. Expected 2. /polyprint/test.asp, line 31 Line 31 is this line from below:
11
3019
by: Andrew Thompson | last post by:
I have written a few scripts to parse the URL arguments and either list them or allow access to the value of any parameter by name. <http://www.physci.org/test/003url/index.html> <http://www.physci.org/test/003url/index.html?url=http://mybiz.com/&that=this&when=now#21> <http://www.physci.org/test/003url/index.html?url=http://mybiz.com/&when=now> Before I go offering it in public (and writing it into any number of the 'development kits'...
3
23175
by: Ryan Hubbard | last post by:
I would like to run a query from VBA. The query will be one with parameters. Is there a way to run the query and have Access prompt for the values like it does if I where to execute it through the database window?
8
11228
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 update 3 row(s)." Is there a way to prevent the message from popping up?
1
2883
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 correctly. 3078" after I migrated "MS Access 2000" to "MS SQL Server 2000" and relinked all linked tables. The front-end interface of my application is MS Access 2000. The back-end is MS SQL Server 2000. After I migrated the database and
1
22293
by: Richard Hollenbeck | last post by:
I wonder what I'm missing? I really feel like a retard because I've been screwing with some code for a very long time. I just must be missing something very simple. In the following example, I've stripped away everything that doesn't cause the error to make my question a little simpler. Here's the problem in its simplest form inside a report: Dim db As DAO.Database
4
10679
by: HeislerKurt | last post by:
I'm getting the infamous error, "Too few parameters. Expected 2", when executing an update SQL statement in VBA. I assume it's a SQL syntax issue, but I can't find the problem, and I used a VBA generator to generate the SQL statement. Debugging points to this line: dbs.Execute strSQl, dbFailOnError Here's the code:
1
1833
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 showing me the right Record each time. But when I'm taking this query in ASP page it is giving me this Err: Error Type: Microsoft OLE DB Provider for ODBC Drivers (0x80040E10) Too few parameters. Expected 1. /imagine/ShowJobDetailTest.asp, line 36...
1
3559
by: TheGuyKnownAsY | last post by:
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' Too few parameters. Expected 1. /misc/page.asp, line 135 Code <%
0
8381
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8893
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8799
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7401
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6209
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5681
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4205
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2792
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2026
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.