<%@ Language=VBScript %>
<HTML>
<HEAD><TITLE>Fast Retrieve</TITLE></HEAD>
<BODY>
<%
    Dim conn, rst, strSQL, myPath, fld, allShippers, RowCounter, ColCounter
    Dim NumOfCols, NumOfRows, currField
    strSQL = "SELECT * FROM Shippers ORDER BY ShipperId"
    myPath = "C:\Learn_ASP_Classic\Northwind.mdb"
    Set conn = Server.CreateObject("ADODB.Connection")
    conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & myPath
    Set rst = conn.Execute(strSQL)

    Response.Write "<TABLE Border=1><TR>" & VbCrLf
        For Each fld In rst.Fields
            Response.Write "<TD><B>" & fld.name & "</B></TD>" & VbCrLf
        Next
    Response.Write "</TR>" & VbCrLf
    allShippers = rst.GetRows

    rst.Close
    Set rst = Nothing
    conn.Close
    Set conn = Nothing

    NumOfCols = UBound(allShippers, 1) 'columns returned
    NumOfRows = UBound(allShippers, 2) 'rows returned
    For RowCounter = 0 To NumofRows
        Response.Write "<TR>"& VbCrLf
        For ColCounter = 0 To NumOfCols
            currField = allShippers(ColCounter, RowCounter)
            If IsNull(currField) Then
                currField = currField & "<BR>"
            ElseIf currField= "" Then
                currField="."
            End If
            Response.Write "<TD Valign=Top>"
            Response.Write currField
            Response.Write "</TD>" & VbCrLf
        Next
        Response.Write "<TR>" & VbCrLf
    Next
    Response.Write "</TABLE>"
%>
</BODY>
</HTML>
