home *** CD-ROM | disk | FTP | other *** search
- <form method="Post" Action="iiatmd2.asp#select">
- <input type="hidden" name="ShowData" value="True"><p align="center"><input type="Submit" Value="Show Me"></p>
- </form>
-
- <% 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)
-
- %>
- <Center>
- <TABLE BORDER=1>
- <% Do While Not rsCustomerList.EOF %>
- <TR><TD width=105><% = rsCustomerList("ContactFirstName") %></TD><TD width=105><%= rsCustomerList("ContactLastName") %></TD><TD width=110><% = rsCustomerList("City") %></TD><TD width=27><% = rsCustomerList("StateOrProvince") %></TD></TR>
- <% rsCustomerList.MoveNext
- Loop %>
- </TABLE>
- </Center>
- <% Else %>
- <Center>
- <TABLE BORDER=1>
- <TR><TD width=105> </TD><TD width=105> </TD><TD width=110> </TD><TD width=27><BR></TD></TR>
- <TR><TD width=105> </TD><TD width=105> </TD><TD width=110> </TD><TD width=27><BR></TD></TR>
- <TR><TD width=105> </TD><TD width=105> </TD><TD width=110> </TD><TD width=27><BR></TD></TR>
- </Table>
- </Center>
- <%End if%>
-