Αρχή :: Ενότητες :: FrontPage :: Απαντήσεις     
 

Forum

error '80040e10' - Από {p_p}

Οταν παω να κανω login σε μια προστατευμένη σελίδα βγαζει:

Microsoft OLE DB Provider for ODBC Drivers error '80040e10'

[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.

/freedata/login/check_user.asp, line 33
--------------

στο check_user.asp, από line 33 και κάτω, γραφει:
'Query the database
rsCheckUser.Open strSQL, strCon

'If the recordset finds a record for the username entered then read in the password for the user
If NOT rsCheckUser.EOF Then

'Read in the password for the user from the database
If (Request.Form("txtUserPass")) = rsCheckUser("Password") Then

---------------------------
Η βαση ειναι access. ευχαριστω

 


Απάντηση από:Psaxtiris

δώσε καλύτερα και τον κώδικα από το strSQL

Απάντηση από:p_p

ΑΥΤΟ ΕΙΝΑΙ ΟΛΟ ΤΟ check_user.asp :
<%
'Dimension variables
Dim adoCon 'Database Connection Variable
Dim strCon 'Holds the Database driver and the path and name of the database
Dim rsCheckUser 'Database Recordset Variable
Dim strAccessDB 'Holds the Access Database Name
Dim strSQL 'Database query sring
Dim strUserName 'Holds the user name

'Initalise the strUserName variable
strUserName = Request.Form("txtUserName")

'Check the database to see if user exsits and read in there password
'Initialise the strAccessDB variable with the name of the Access Database
strAccessDB = "users"

'Create a connection odject
Set adoCon = Server.CreateObject("ADODB.Connection")

'Database connection info and driver
strCon = "DRIVER={Microsoft Access Driver (*.mdb)};uid=;pwd=letmein; DBQ=" & Server.MapPath(strAccessDB)

'Set an active connection to the Connection object
adoCon.Open strCon

'Create a recordset object
Set rsCheckUser = Server.CreateObject("ADODB.Recordset")

'Initalise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT tblUsers.Password FROM tblUsers WHERE tblUsers.UserID ='" & strUserName & "'"

'Query the database
rsCheckUser.Open strSQL, strCon

'If the recordset finds a record for the username entered then read in the password for the user
If NOT rsCheckUser.EOF Then

'Read in the password for the user from the database
If (Request.Form("txtUserPass")) = rsCheckUser("Password") Then

'If the password is correct then set the session variable to True
Session("blnIsUserGood") = True

'Close Objects before redirecting
Set adoCon = Nothing
Set strCon = Nothing
Set rsCheckUser = Nothing

'Redirect to the authorised user page and send the users name
Response.Redirect"authorised_user_page.asp?name=" & strUserName
End If
End If

'Close Objects
Set adoCon = Nothing
Set strCon = Nothing
Set rsCheckUser = Nothing

'If the script is still running then the user must not be authorised
Session("blnIsUserGood") = False

'Redirect to the unautorised user page
Response.Redirect"unauthorised_user_page.htm"
%>
------------------------------
------------------------------
ΑΥΤΟ ΕΙΝΑΙ ΟΛΟ ΤΟ authorised_user_page.asp

<%
'If the session variable is False or does not exsist then redirect the user to the unauthorised user page
If Session("blnIsUserGood") = False or IsNull(Session("blnIsUserGood")) = True then
'Redirect to unathorised user page
Response.Redirect"unauthorised_user_page.htm"
End If
%>
<html>
<head>
<meta http-equiv="Content-Language" content="el">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">

<title>Authorised User</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1253">


<!-- The Web Wiz Guide Login Script is written by Bruce Corkhill ©2001
If you want your own Login Script then goto http://www.webwizguide.info -->

<%
'Dimension Variables
Dim strUserName 'Holds the name of the user

'Get the users name passed from the previous page
strUserName = Request.QueryString("name")
%>

</head>

<body bgcolor="#FFFFFF" text="#000000">
<table width="518" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td align="center">
<h1>Authorised Access</h1>
</td>
</tr>
</table>
<div align="center">
<p><br>
Welcome <b>
<% =strUserName %>
</b> to the password proteceted area of the web site. </p>
<p>&nbsp;</p>
<p><a href="http://www.webwizguide.info" target="_blank"><img src="web_wiz_guide.gif" width="100" height="30" border="0" alt="Web Wiz Guide!"></a>
</p>
</div>
</body>
</html>
=================================================
eyxaristw poly

Απάντηση από:Psaxtiris

Δεν βλέπω κάτι λάθος...βεβαιώσου ότι υπάρχουν τα πεδία(Password, UserID) στη βάση και έχουν τα ίδια ονόματα.



tip: Μην παραπονιέσαι για κάτι που δεν μπορεί να διορθωθεί , αλλά διόρθωσε αυτό που σε κάνει να παραπονιέσαι . * F5 για νέο tip

   Πίσω στην προηγούμενη σελίδα






Η Εταιρία | Web Hosting | Domain names | Web Information | Υπηρεσίες | Resellers | Υποστήριξη |
Copyright © 2007–09 4GR.NETWORKS, All rights reserved.