Link to home
Start Free TrialLog in
Avatar of Light Worker Of Norway
Light Worker Of NorwayFlag for Norway

asked on

access error 0x80040E10, pleaz Help !!

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
Avatar of Mark Franz
Mark Franz
Flag of United States of America image

Try a complete SQL string;

strSQL = "Select * From personer Where bruker = "&user&";"
Avatar of Light Worker Of Norway

ASKER

nop :-(
Avatar of msdixon
msdixon

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.
Where are you opening the RS?  Try adding this to the code, before you execute the SQL;

Set rs = Server.CreateObject("ADODB.Recordset")
msdixon, I think you would get a 80004005 error if it was permissions...
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.
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
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
mgfranz  :

Yes the name is 'passord', I'm a Norwegian, and that's the
word for 'password' !!
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")
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
mgfranz  :

Yes, the records are being returned?

.... Wait :::::
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

NOp, I'm sorry , no records returned, only the error !!
NOp, I'm sorry , no records returned, only the error !!
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
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?
Read this :

When I'm using the ID of the record it's working.
The ID is the primary key !!
I get this error when I have misspelled a column name in my SQL string.  
Is "user" a string or an integer?
"user" is a string
So this works?

strSQL = "Select * From personer Where bruker = fred"
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
ASKER CERTIFIED SOLUTION
Avatar of allie
allie

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanx allie !!

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

:oD