Ciao a tutti, vorrei sapere se è possibile personalizzare questa login che così come è funziona, ma non con un database access protetto da password.
Ho trovato su un esempio come fare ma non so bene come integrarlo con il mio.
Qui sotto il codicex richiamare un database protetto:
ADOConn = new ActiveXObject("ADODB.Connection");
strConn = "";
strConn += "driver={Microsoft Access Driver (*.mdb)};";
strConn += "dbq=" + Server.MapPath("utenza.mdb") + ";";
strConn += "pwd=prova"; // SELEZIONARE QUI LA PASSWORD DI ACCESSO AL DATABASE SCELTA!
qui il codice semplice che sto usando xla login:
<%
Dim nome_ut
Dim pass
nome_ut = Replace(Request.Form("nome_utente"), "'", "''")
pass = Replace(Request.Form("password"), "'", "''")
Dim cn
Set cn = Server.CreateObject("ADODB.Connection")
cn.Open "driver={Microsoft Access Driver (*.mdb)};dbq="&Server.MapPath("utenti.mdb")
Dim sql
sql = "SELECT ID FROM Utenti WHERE NOMEUTENTE='" &nome_ut&_
"' AND PASSWORD='" &pass& "'"
Dim rs
Set rs = cn.Execute(sql)
Dim autenticato
if rs.eof then
autenticato = false
else
autenticato = true
end if
rs.Close
cn.Close
Set rs = Nothing
Set cn = Nothing
if autenticato = true then
Session("Autenticato") = "OK"
Response.Redirect("index.asp")
else
Response.Redirect("errore.asp")
end if
%>
Grazie a chi può darmi una mano
Ciao Japan

Rispondi quotando
