<% If Request.Form("ShowData") = "True" then 'Find the physical path for the file in the current directory. strDBVirtualPath = "/iishelp/iis/htm/tutorial/EECustmr.mdb" strDBLocation = Server.Mappath(strDBVirtualPath) 'Define OLE-DB connection string. 'strSource = "Provider=Microsoft.Jet.OLEDB.3.51;Data Source=" & strDBLocation 'Define ODBC connection string strSource = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & strDBLocation %> <% 'Instantiate ADO Connection Object and open a connection Set dbConnection = Server.CreateObject("ADODB.Connection") dbConnection.Open strSource 'Define SQL Query and execute ADO Recordset query SQLQuery = "SELECT * FROM Customers" Set rsCustomerList = dbConnection.Execute(SQLQuery) %>
<% Do While Not rsCustomerList.EOF %> <% rsCustomerList.MoveNext Loop %>
<% = rsCustomerList("ContactFirstName") %><%= rsCustomerList("ContactLastName") %><% = rsCustomerList("City") %><% = rsCustomerList("StateOrProvince") %>
<% Else %>
   
   
   
<%End if%>