Solved

access error 0x80040E10, pleaz Help !!

Posted on 2001-07-09
26
277 Views
Last Modified: 2012-05-04
I have a Page validating password, as I start building it
I've tried to test it, and when the validating page runs I
get this error :

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
/test/passord/registrering/validering.asp, line 15

The Error line 15 is the execute sql line, but I can't see
the point of telling me that there are too few parameters !!

Can someone look at my code below and tell me what's wrong !!




CODE STARTS :

<%
' set up connection
Set Conn = Server.CreateObject("ADODB.Connection")
DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; "
DSN = DSN & "DBQ=" & Server.MapPath ("database.mdb")
Conn.Open DSN

  User = Request.Form("txtUser")
  Pass = Request.Form("txtPass")

response.write(user)

' get from database & compare
strSQL = "Select * From personer Where bruker = " & user
Set rs = Conn.Execute(strSQL)

if rs("passord") = Pass then
session("abbonement") = rs("type")
session("brukernavn") = user
Conn.Close
Set Conn = Nothing
response.write ("<script>parent.location='../karidreitisenga/memi.asp'</script>")
else
response.redirect"../main.asp"
end if

Conn.Close
Set Conn = Nothing
%>

CODE END
0
Comment
  • 12
  • 9
  • 2
  • +2
26 Comments
 
LVL 18

Expert Comment

by:mgfranz
ID: 6266067
Try a complete SQL string;

strSQL = "Select * From personer Where bruker = "&user&";"
0
 

Author Comment

by:Light Worker Of Norway
ID: 6266086
nop :-(
0
 
LVL 9

Expert Comment

by:msdixon
ID: 6266122
i had this error before, but it's been a while. make sure that the iusr_machineName user has permission to access both the folder and the actual database itself.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 18

Expert Comment

by:mgfranz
ID: 6266131
Where are you opening the RS?  Try adding this to the code, before you execute the SQL;

Set rs = Server.CreateObject("ADODB.Recordset")
0
 
LVL 18

Expert Comment

by:mgfranz
ID: 6266133
msdixon, I think you would get a 80004005 error if it was permissions...
0
 
LVL 9

Expert Comment

by:msdixon
ID: 6266147
mgfranz,

yes, i know, but i remeber getting this error once, and it really threw me. if i remember correctly, it didn't have anything to do with the way the connection or recordset was being opened. it was something weird... but i can't remember what exactly was causing the error.
0
 
LVL 18

Expert Comment

by:mgfranz
ID: 6266152
And watch your spelling sonny, is the field really passord?  Or should it be password?  (I have no idea what language you are using so I may be off in left field with this...).

Also, try this conn string;

conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & Server.MapPath("database.mdb")

I found 1 article in MSDN that might help;

http://support.microsoft.com/support/kb/articles/Q207/5/86.ASP
0
 

Author Comment

by:Light Worker Of Norway
ID: 6266184
I've tried to implant the 'Set rs = Server.CreateObject("ADODB.Recordset")'
, I've also checked the premissions.
But The server still give me the same error :-(
 
........Maybe it dont like me :-D
0
 

Author Comment

by:Light Worker Of Norway
ID: 6266197
mgfranz  :

Yes the name is 'passord', I'm a Norwegian, and that's the
word for 'password' !!
0
 
LVL 18

Expert Comment

by:mgfranz
ID: 6266215
Are the records being returned?

strSQL = "Select * From personer Where bruker = " & user &""
Set rs = Conn.Execute(strSQL)

Response.Write rs("passord")
Response.Write rs("user")
0
 

Author Comment

by:Light Worker Of Norway
ID: 6266225
mgfranz  :

when I change the open seqense to :
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & Server.MapPath("database.mdb")

I'll get :

Error Type:
Microsoft JET Database Engine (0x80040E10)
No value given for one or more required parameters.
/test/passord/registrering/validering.asp, line 17
0
 

Author Comment

by:Light Worker Of Norway
ID: 6266228
mgfranz  :

Yes, the records are being returned?

0
 

Author Comment

by:Light Worker Of Norway
ID: 6266234
.... Wait :::::
0
 
LVL 18

Expert Comment

by:mgfranz
ID: 6266238
Try this;

<%
' set up connection
Set Conn = Server.CreateObject("ADODB.Connection")
DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; "
DSN = DSN & "DBQ=" & Server.MapPath ("database.mdb")
Set rs = Server.CreateObject("ADODB.Recordset")
'Conn.Open DSN

 User = Request.Form("txtUser")
 Pass = Request.Form("txtPass")
' Does this return write correctly?
response.write(user)

' get from database & compare
strSQL = "Select * From personer Where bruker = " & user &""
rs.Open Conn, strSQL, 3, 3

Response.Write rs("passord")
Response.Write rs("user")
...

And make sure the form values are being written correctly before running the SQL and Open.  


 User = Request.Form("txtUser")
 Pass = Request.Form("txtPass")
' Does this return write correctly?
response.write(user)
response.write (Pass)

' get from database & compare
'strSQL = "Select * From personer Where bruker = " & user &""
'rs.Open Conn, strSQL, 3, 3

0
 

Author Comment

by:Light Worker Of Norway
ID: 6266243
NOp, I'm sorry , no records returned, only the error !!
0
 

Author Comment

by:Light Worker Of Norway
ID: 6266271
NOp, I'm sorry , no records returned, only the error !!
0
 

Author Comment

by:Light Worker Of Norway
ID: 6266278
mgfranz  re:Try this

Gives the Error

Error Type:
ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/test/passord/registrering/validering2.asp, line 17
, line 17
0
 
LVL 18

Expert Comment

by:mgfranz
ID: 6266287
Comment out all the conn.Execute code, make sure the Form values are passed correctly before executing them.

Also, is User the same as user?
0
 

Author Comment

by:Light Worker Of Norway
ID: 6266382
Read this :

When I'm using the ID of the record it's working.
The ID is the primary key !!
0
 
LVL 1

Expert Comment

by:tkuppinen
ID: 6266423
I get this error when I have misspelled a column name in my SQL string.  
0
 
LVL 18

Expert Comment

by:mgfranz
ID: 6266458
Is "user" a string or an integer?
0
 

Author Comment

by:Light Worker Of Norway
ID: 6266570
"user" is a string
0
 
LVL 18

Expert Comment

by:mgfranz
ID: 6266592
So this works?

strSQL = "Select * From personer Where bruker = fred"
0
 
LVL 2

Expert Comment

by:allie
ID: 6266644
MR SONNY-

You've got the right code, you just forgot the quotation marks around your parameter.  The line should be:

strSQL="Select * from personer Where bruker='" & user &"'"

(So "Select * from personer where bruker=fred" won't work, but "Select * from personer where bruker='fred'" should work.)  Good luck!

allie
0
 
LVL 2

Accepted Solution

by:
allie earned 50 total points
ID: 6266649
I just realized you can't see it all that well on this screen, so just to be clear, all you're doing is surrounding the user ID in single quotation marks.

allie
0
 

Author Comment

by:Light Worker Of Norway
ID: 6266835
Thanx allie !!

You really opned the eyes of a newbee here (Thats what I am !)

:oD
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question