<%@ import namespace="system.data.oleDb" %> |
|
<Script runat="server"> |
|
Sub page_load |
|
Dim dbconn as oledbConnection |
Dim dbCMD as oleDbCommand |
Dim dtr as oledbdatareader |
|
' Server.MapPath("[relative path to your database]") |
dbConn = New oledbConnection ("PROVIDER= Microsoft.ACE.OLEDB.12.0;DATA Source=" & server.MapPath("/test.accdb")) |
dbConn.open() |
dbCMD = new oleDbCommand ("select * from tblContact",dbconn) |
dtr = dbCMD.executereader() |
|
While dtr.read() |
response.write ("<li>") |
response.write (dtr(0) & "---" & dtr(1)) |
End while |
|
dtr.close() |
dbConn.close() |
|
End Sub |
|
</Script> |
Article ID: 174, Created: July 25, 2012 at 12:44 AM, Modified: July 25, 2012 at 12:44 AM