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

K

kbrad

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.UserEmailAddress, " _
& "tblUserDetails.UserFirstName, tblUserDetails.UserSurname, " _
& "tblUserDetails.UserPhoneNo, tblUserDetails.UserCompany " _
& "FROM tblUserDetails" _
& " WHERE tblUserDetails.UserName =" & recSel

rsUpdateUser.Open strSQL, adoCon, adOpenDynamic, adLockOptimistic
 
6

'69 Camaro

Hi.

First, ASP isn't a programming language that Microsoft Access uses. What I
see as a probable syntax error with VBA and Jet SQL might not make any
difference in ASP. If the code below were contained in a VBA procedure and
the field UserName was a text (string) data type, then the syntax on the
last line would need to be changed to:

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

Next, check to ensure that all of the field names listed are spelled
correctly and all of these fields exist in the table.

Third, if the field name UserPw is a field that stores users' passwords,
then please reconsider your approach of using a Web interface with an Access
database, because this provides no security for these passwords.

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
 
Top