Light Worker Of 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 /validerin g.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 .Connectio n")
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= '../karidr eitisenga/ memi.asp'< /script>")
else
response.redirect"../main. asp"
end if
Conn.Close
Set Conn = Nothing
%>
CODE END
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
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
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=
else
response.redirect"../main.
end if
Conn.Close
Set Conn = Nothing
%>
CODE END
ASKER
nop :-(
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 ")
Set rs = Server.CreateObject("ADODB
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.
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.OL EDB.4.0;" & "Data Source=" & Server.MapPath("database.m db")
I found 1 article in MSDN that might help;
http://support.microsoft.com/support/kb/articles/Q207/5/86.ASP
Also, try this conn string;
conn.Open "Provider=Microsoft.Jet.OL
I found 1 article in MSDN that might help;
http://support.microsoft.com/support/kb/articles/Q207/5/86.ASP
ASKER
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
, I've also checked the premissions.
But The server still give me the same error :-(
........Maybe it dont like me :-D
ASKER
mgfranz :
Yes the name is 'passord', I'm a Norwegian, and that's the
word for 'password' !!
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")
strSQL = "Select * From personer Where bruker = " & user &""
Set rs = Conn.Execute(strSQL)
Response.Write rs("passord")
Response.Write rs("user")
ASKER
mgfranz :
when I change the open seqense to :
conn.Open "Provider=Microsoft.Jet.OL EDB.4.0;" & "Data Source=" & Server.MapPath("database.m db")
I'll get :
Error Type:
Microsoft JET Database Engine (0x80040E10)
No value given for one or more required parameters.
/test/passord/registrering /validerin g.asp, line 17
when I change the open seqense to :
conn.Open "Provider=Microsoft.Jet.OL
I'll get :
Error Type:
Microsoft JET Database Engine (0x80040E10)
No value given for one or more required parameters.
/test/passord/registrering
ASKER
mgfranz :
Yes, the records are being returned?
Yes, the records are being returned?
ASKER
.... Wait :::::
Try this;
<%
' set up connection
Set Conn = Server.CreateObject("ADODB .Connectio n")
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
<%
' set up connection
Set Conn = Server.CreateObject("ADODB
DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; "
DSN = DSN & "DBQ=" & Server.MapPath ("database.mdb")
Set rs = Server.CreateObject("ADODB
'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
ASKER
NOp, I'm sorry , no records returned, only the error !!
ASKER
NOp, I'm sorry , no records returned, only the error !!
ASKER
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 /validerin g2.asp, line 17
, line 17
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
, 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?
Also, is User the same as user?
ASKER
Read this :
When I'm using the ID of the record it's working.
The ID is the primary key !!
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?
ASKER
"user" is a string
So this works?
strSQL = "Select * From personer Where bruker = fred"
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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanx allie !!
You really opned the eyes of a newbee here (Thats what I am !)
:oD
You really opned the eyes of a newbee here (Thats what I am !)
:oD
strSQL = "Select * From personer Where bruker = "&user&";"