<HTML>
<HEAD>
<TITLE>PROVA ASP</TITLE>
</HEAD>
<BODY>
<%
'Creo la connessione al Database
Set Conn = Server.CreateObject("ADODB.Connection")
DSNtest="DRIVER={Microsoft Access Driver (*.mdb)}; "
DSNtest=dsntest & "DBQ=" & Server.MapPath("test.mdb")
Conn.Open DSNtest
'creo l'oggetto Recordset
Dim rs
Set rs = Server.CreateObject("ADODB.Recordset")
'Eseguo la query SQL SELECT
rs.Open "SELECT * FROM Studenti", conn
'Controllo di errore
If rs.eof then
response.write "non ci sono record"
response.end
Else
%>
<div align="center">
<center>
<table border="1" bordercolor="#111111" width="50%" id="AutoNumber1">
<%
'Visualizzazione recor
Do While not rs.EOF
%> <tr>
<td width="25%">
<%ID = rs("ID")
response.write ID %> </td>
<td width="25%">
<%Nome = rs("Nome")
response.write Nome %> </td>
<td width="25%">
<%Cognome = rs("Cognome")
response.write Cognome %> </td>
<td width="25%">
<%Data = rs("Data")
response.write Data %> </td>
</tr>
<% rs.MoveNext
Loop
%> </table>
<%
'Chiusura elementi
rs.close
set rs=nothing
End If
Conn.close
set Conn = nothing
%>
</center>
</div>
</BODY>
</HTML>