<%@ Language=VBScript %> <html> <head> <!--MAY GOD ALMIGHTY INCREASE MY KNOWLEDGE FOR WELLBEING OF MANKIND--> <!--Original: Syed Armoghan Qadir Shah (Armoshah@hotmail.com)--> <!-- This vbScript Source!! http://www.sei-incentives.com--> <!--Email your questions to Syed at Armoshah@hotmail.com--> <meta NAME="GENERATOR" Content="Microsoft FrontPage 4.0"> <title></title> </head> <body> <h2 align="center"> Northwind Order Details </h2> <p align="center"> Please Press the browser Back Button to go back to Award Express <a href="master.asp"> Orders </a> Page </p> <br> <script LANGUAGE="vbscript" RUNAT="Server"> '--Declare variables Dim cn, rs, drs Dim strConnect, strSQL, intCounter, strSQL2 Dim intOrderID intOrderID = CInt(Request.QueryString("strID")) Set cn = Server.CreateObject("ADODB.Connection") strConnect = "DSN=Northwind" Call cn.Open(strConnect) '--Create Multiple Recordsets Set rs = Server.CreateObject("ADODB.Recordset") set rs2 = Server.CreateObject("ADODB.Recordset") '--The SQL Statement strSQL = " SELECT * FROM [Orders] O WHERE O.OrderID=" & intOrderID strSQL2 = "SELECT * FROM [Order Details] D WHERE D.OrderID =" & intOrderID Call rs.Open(strSQL, strConnect, 0, 1) Call rs2.Open(strSQL2, strConnect, 0, 1) DO WHILE NOT rs.EOF Call Response.Write("<Table border = 3 cellpadding=2 cellspacing=2>") Call Response.Write("<TD width=0 bgcolor=#800000>" & "<B><I><font color=#ffffff>Orders</I></B>" & "</td>") Call Response.Write("<Tr>") '--Write out Custom Headings Call Response.Write("<TH>" & "<B>Order ID</B>" & "</TH>") Call Response.Write("<TH>" & "<B>Customer ID</B>" & "</TH>") Call Response.Write("<TH>" & "<B>Order Date</B>" & "</TH>") Call Response.Write("<TH>" & "<B>Required Date</B>" & "</TH>") Call Response.Write("<TH>" & "<B>Shipped Date</B>" & "</TH>") Call Response.Write("<TH>" & "<B>Ship Via</B>" & "</TH>") Call Response.Write("<TH>" & "<B>Freight</B>" & "</TH>") Call Response.Write("<TH>" & "<B>Address</B>" & "</TH>") Call Response.Write("<TH>" & "<B>City</B>" & "</TH>") Call Response.Write("<TH>" & "<B>Region</B>" & "</TH>") Call Response.Write("<TH>" & "<B>Postal Code</B>" & "</TH>") Call Response.Write("<TH>" & "<B>Country</B>" & "</TH>") Call Response.Write("</Tr>") '--Write out data in the fields Call Response.Write("<Tr>") Call Response.Write("<td>" & rs.Fields("OrderID") & "</td>") Call Response.Write("<td>" & rs.Fields("CustomerID") & "</td>") Call Response.Write("<td>" & rs.Fields("OrderDate") & "</td>") Call Response.Write("<td>" & rs.Fields("RequiredDate") & "</td>") Call Response.Write("<td>" & rs.Fields("ShippedDate") & "</td>") Call Response.Write("<td>" & rs.Fields("ShipVia") & "</td>") Call Response.Write("<td>" & rs.Fields("Freight") & "</td>") Call Response.Write("<td width=25%>" & rs.Fields("ShipAddress") & "</td>") Call Response.Write("<td>" & rs.Fields("ShipCity") & "</td>") Call Response.Write("<td>" & rs.Fields("ShipRegion") & "</td>") Call Response.Write("<td width=15%>" & rs.Fields("ShipPostalCode") & "</td>") Call Response.Write("<td width=15%>" & rs.Fields("ShipCountry") & "</td>") Call Response.Write("</Tr>") Call Response.Write("</Table>") rs.Movenext Loop Response.Write "&nbsp;" Response.Write "&nbsp;" '--Set drs = rs("Order_Details").value Call Response.Write("<Table border = 3 cellpadding=2 cellspacing=2>") Call Response.Write("<TD width=0 bgcolor=#800000>" & "<B><I><font color=#ffffff>Order Details</I></B>" & "</td>") Call Response.Write("<Tr>") '--Write out Custom Headings Call Response.Write("<TH>" & "<B>Product ID</B>" & "</TH>") Call Response.Write("<TH>" & "<B>Quantity</B>" & "</TH>") Call Response.Write("<TH>" & "<B>Unit Price</B>" & "</TH>") Call Response.Write("<TH>" & "<B>Discount</B>" & "</TH>") Call Response.Write("</Tr>") While(rs2.EOF=False) '--Write out all available data Call Response.Write("<Tr>") Call Response.Write("<td>" & rs2.Fields("ProductID") & "</td>") Call Response.Write("<td>" & rs2.Fields("Quantity") & "</td>") Call Response.Write("<td>" & rs2.Fields("UnitPrice") & "</td>") Call Response.Write("<td>" & rs2.Fields("Discount") & "</td>") Call Response.Write("</Tr>") rs2.MoveNext WEND Call Response.Write("</Table>") Set rs2 = Nothing Set rs = Nothing Set cn = Nothing </script> </body> </html>