<%@ Language=VBScript %>
<HTML>
<HEAD><TITLE>Lookup Results</TITLE></HEAD>
<BODY>
<%
    Dim mySQL, myPath
    CustomerID = TRIM(Request.QueryString("CustomerID"))
    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 = Server.CreateObject("ADODB.Recordset")
    rst.CursorType = 3 'adOpenStatic
    mySQL= "SELECT * FROM Customers WHERE CustomerID='" & CustomerID & "'"
    rst.Open mySQL,conn
%>
    <H1>Address Lookup</H1>
    <I>Displaying address for <B><%=rst("CompanyName")%></B></I>
    <HR>
    <TABLE colspan=2 align="Center">
    <TR>
        <TD>Customer ID:</TD>
        <TD><input type="text" name="CustomerID"
            value="<%=rst("CustomerID")%>" size="5">
        </TD>
   </TR>
   <TR>
        <TD>Street:</TD>
        <TD><input type="text" name="Address"
            value="<%=rst("Address")%>" size="60">
        </TD>
    </TR>
    <TR>
        <TD>City:</TD>
        <TD><input type="text" name="City"
            value="<%=rst("City")%>" size="15">
        </TD>
    </TR>
    <TR>
        <TD>Region:</TD>
        <TD><input type="text" name="Region"
            value="<%=rst("Region")%>" size="15">
        </TD>
    </TR>
    <TR>
        <TD>Country:</TD>
       <TD><input type="text" name="Country"
           value="<%=rst("Country")%>" size="15">
       </TD>
    </TR>
    <TR>
        <TD>Zip:</TD>
        <TD><input type="text" name="PostalCode"
            value="<%=rst("PostalCode")%>" size="10">
        </TD>
    </TR>
    <TR>
        <TD>Phone:</TD>
        <TD><input type="text" name="Phone"
            value="<%=rst("Phone")%>" size="24">
        </TD>
    </TR>
    <TR>
        <TD>Fax:</TD>
        <TD><input type="text" name="Fax"
            value="<%=rst("Fax")%>" size="24">
        </TD>
    </TR>
    </TABLE>
    <BR>
    <BR>
    <CENTER>[  <A HREF="VBScript:history.back(1)">Go Back </A>  ]</CENTER>
<%
    rst.close
    Set rst = Nothing
    conn.Close
    Set conn = Nothing
%>
</BODY>
</HTML>
