Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 407
  • Last Modified:

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
0
Light Worker Of Norway
Asked:
Light Worker Of Norway
  • 12
  • 9
  • 2
  • +2
1 Solution
 
mgfranzCommented:
Try a complete SQL string;

strSQL = "Select * From personer Where bruker = "&user&";"
0
 
Light Worker Of NorwayAuthor Commented:
nop :-(
0
 
msdixonCommented:
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
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

 
mgfranzCommented:
Where are you opening the RS?  Try adding this to the code, before you execute the SQL;

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

Yes the name is 'passord', I'm a Norwegian, and that's the
word for 'password' !!
0
 
mgfranzCommented:
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
 
Light Worker Of NorwayAuthor Commented:
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
 
Light Worker Of NorwayAuthor Commented:
mgfranz  :

Yes, the records are being returned?

0
 
Light Worker Of NorwayAuthor Commented:
.... Wait :::::
0
 
mgfranzCommented:
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
 
Light Worker Of NorwayAuthor Commented:
NOp, I'm sorry , no records returned, only the error !!
0
 
Light Worker Of NorwayAuthor Commented:
NOp, I'm sorry , no records returned, only the error !!
0
 
Light Worker Of NorwayAuthor Commented:
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
 
mgfranzCommented:
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
 
Light Worker Of NorwayAuthor Commented:
Read this :

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

strSQL = "Select * From personer Where bruker = fred"
0
 
allieCommented:
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
 
allieCommented:
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
 
Light Worker Of NorwayAuthor Commented:
Thanx allie !!

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

:oD
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 12
  • 9
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now