Validate logins with ASP, MS Access and Cookies error
- From: "malcolm" <malcolm.whyte@xxxxxxxxxxxxxxxxx>
- Date: Sat, 15 Apr 2006 16:07:02 +0100
Hi, while trying to validate username and password on login form I am
presented with the following error message
Microsoft JET Database Engine error '80040e10'
No value given for one or more required parameters.
/vdateUsr.asp, line 53
The 2 fields within the database are text fields (UID) and (PWD) these are
spelt correctly!
This is the code that I am using:
<%@Language=VBScript%>
<!-- METADATA TYPE="typelib"
FILE="C:\Program Files\Common
Files\System\ado\msado15.dll" -->
<!-- #include file="Connectionstring.asp" -->
<%
' /////////////////////////////////////
' login validation script
' © Matt Millross
' www.designplace.org
' free for use as long as copyright notice left intact
' For more scripts, visit www.designplace.org
' /////////////////////////////////////
' variables
dim cnStr
dim rcSet
dim frmUsername
dim frmPassword
dim sqlStr
'store form input into variables
frmUsername = Request.Form("UID")
frmPassword = Request.Form("PWD")
'create connection and recordset objects
Set cnStr = Server.CreateObject("ADODB.Connection")
Set rcSet = Server.CreateObject("ADODB.Recordset")
' defining database connection (connectionstring.asp)
cnStr.ConnectionString = path
cnStr.Provider = provider
cnStr.open
' execute sql and open as recordset
sqlStr = "Select * From tblusers where username = '" _
& Request.Form("UID") & "' and password = '" & Request.Form("PWD") & "'"
' Opens the returned values from the SQL as a recordset, ready for iteration
by ASP
<<< LINE 53 >>> set rcSet = cnStr.Execute(sqlStr)
' validate variables against database
If (not rcSet.BOF) and (not rcSet.EOF) then
response.cookies("validated_user") = frmUsername
response.write "<h1>Login successful!</h1>"
response.write "<p>Welcome " & rcSet.fields(1) & "</p>"
else
response.write "incorrect username and/or password"
end if
%>
Unfortunately I am new to all this and would welcome any feedback on this
error.
Malcolm
.
- Follow-Ups:
- Re: Validate logins with ASP, MS Access and Cookies error
- From: Emil Cristen
- Re: Validate logins with ASP, MS Access and Cookies error
- From: Mike Brind
- Re: Validate logins with ASP, MS Access and Cookies error
- From: Steven Burn
- Re: Validate logins with ASP, MS Access and Cookies error
- Prev by Date: Re: Local web server for classic asp
- Next by Date: Re: Validate logins with ASP, MS Access and Cookies error
- Previous by thread: Local web server for classic asp
- Next by thread: Re: Validate logins with ASP, MS Access and Cookies error
- Index(es):
Relevant Pages
|
Loading