Ciao. Ho un database con due tabelle. Ho una tabella utenti dove per ogni utente ho:
- user
- password
Volevo leggere dal database "database.mdb" e stampare tutti gli user.
codice:<html lang="it"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Login</title> </head> <body> <% var con; var sConString; var sSQLString; con = Server.CreateObject("ADODB.Connection"); sConString = "Provider = Microsoft.Jet.OLEDB.4.0; " + "Data Source = " + Server.MapPath("./database.mdb"); con.Mode = 3; con.Open(sConString); var rst; var ObjRS; ObjRS = Server.CreateObject("ADODB.Recordset"); sSQLString = " Select * from utenti "; rst = con.Execute(sSQLString); while (!rst.EOF) { Response.write(rst("usr") + " "); rst.MoveNext( ); } rst.Close( ); con.Close( ); rst = null; con = null; %> </body> </html>
Il file .asp e il databse sono nella cartella wwwroot. Se provo a lanciare mi da questo errore
An error occurred on the server when processing the URL. Please contact the system administrator

Rispondi quotando