Salve ho un piccolo problemino con la password.In linea di massima funziona bene solamente quando immetto un nome e una password sbagliata mi rimanda questo errore error '80020009'
/login.asp, line 24
Vorrei inserire un direct su una pagina che invita a controllare i dati.
Vi ringrazio anticipatamente
invio un po di codice
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!--#include file="Connections/TaDB.asp" -->
<%
' *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables("URL")
If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" + Request.QueryString
MM_valUsername=CStr(Request.Form("Login"))
If MM_valUsername <> "" Then
MM_fldUserAuthorization=""
MM_redirectLoginSuccess="log.asp"
MM_redirectLoginFailed="areautenti.htm"
MM_flag="ADODB.Recordset"
set MM_rsUser = Server.CreateObject(MM_flag)
MM_rsUser.ActiveConnection = MM_TaDB_STRING
MM_rsUser.Source = "SELECT Login, Password, ID, Nome, Cognome, DataScadenza "
If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization
MM_rsUser.Source = MM_rsUser.Source & " FROM dbo.Clienti WHERE Login='"& Replace(MM_vallogin,"'","''") & MM_valUsername &"' AND Password='" & Replace(Request.Form("password"),"'","''") & "'"
MM_rsUser.CursorType = 0
MM_rsUser.CursorLocation = 2
MM_rsUser.LockType = 3
MM_rsUser.Open
if MM_rsUser.Fields.Item("Datascadenza") < date then <-----linea 24
else
If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
' username and password match - this is a valid user
Response.cookies("UltimoAccesso") = date & " " & time
Response.Cookies("UltimoAccesso").Expires = "01/01/2006"
if Application(MM_valUsername) <> "yes" then
Session("MM_Username") = MM_valUsername
application.lock
Application(MM_valUsername) = "yes"
application.unlock
Session("Cliente") = MM_rsUser.Fields.Item("Nome").Value &" " & MM_rsUser.Fields.Item("Cognome").Value
Session("IdCliente") = MM_rsUser("ID")
If (MM_fldUserAuthorization <> "") Then
Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)
Else
Session("MM_UserAuthorization") = ""
End If
if CStr(Request.QueryString("accessdenied")) <> "" And false Then
MM_redirectLoginSuccess = Request.QueryString("accessdenied")
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginSuccess)
else
response.redirect("areautenti.htm")
end if