Solved

access error 0x80040E10, pleaz Help !!

Posted on 2001-07-09
26
253 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
 
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

757 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now