<% If Request.Form("ShowData") = "True" then 'Find the physical path for the file in the current directory. MainPath = Request.ServerVariables("PATH_TRANSLATED") 'Determine the path for the current page and then remove the 'name of the file from the path (leaving just the directory). Length = Len(MainPath) i = 0 Do Until (i = 2) Do While (Mid(MainPath, Length, 1) <> "\") Length = Length - 1 Loop i = i + 1 MainPath = left(MainPath, (Length-1)) Loop FilePath = left(MainPath, Length) + "\tutorial\" strSource = "DRIVER=Microsoft Access Driver (*.mdb);UID=admin;FIL=MS Access;DBQ="&FilePath&"BTCustmr.mdb" Set dbConnection = Server.CreateObject("ADODB.Connection") dbConnection.Open strSource 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%>