<% |
Dim cnnSimple ' ADO connection |
Dim rstSimple ' ADO recordset |
Set cnnSimple = Server.CreateObject("ADODB.Connection") |
|
' DSNLess |
cnnSimple.Open ("Provider= Microsoft.ACE.OLEDB.12.0;Data Source=" & Server.MapPath("\test.accdb")) |
|
Set rstSimple = cnnSimple.Execute("SELECT * FROM tbltest") |
%> |
|
<P> Connecting to Access with Ole connection </P> |
<table border="1"> |
|
<% |
Do While Not rstSimple.EOF |
%> |
|
<tr> |
<td><%= rstSimple.Fields(0).Value %></td> |
<td><%= rstSimple.Fields(1).Value %></td> |
</tr> |
|
<% |
rstSimple.MoveNext |
Loop |
%> |
|
</table> |
|
<% |
rstSimple.Close |
Set rstSimple = Nothing |
cnnSimple.Close |
Set cnnSimple = Nothing |
%> |
Article ID: 171, Created: July 25, 2012 at 12:42 AM, Modified: July 25, 2012 at 12:42 AM