Source Code for http://194.8.136.100/XSB/products.asp
COLOR LEGEND
| Server Side Script |
| Client Side Script |
| Hyperlink |
| Include |
| Frames |
| Comments |
| Object Code Link |
| Standard HTML and Text |
<% @LANGUAGE = VBScript %>
<%
Option Explicit
Dim objConn, objRS, strQ, strConnection
Set objConn = Server.CreateObject("ADODB.Connection")
strConnection = "provider=sqloledb.1;user id=sa;password=;initial catalog=Northwind;data source=TOPGUN"
objConn.Open strConnection
Set objRS = Server.CreateObject("ADODB.Recordset")
Set objRS.ActiveConnection = objConn
strQ = "SELECT Products.ProductID,Products.ProductName,"
strQ = strQ & "Products.QuantityPerUnit,Products.UnitPrice,"
strQ = strQ & "Categories.CategoryName "
strQ = strQ & "FROM Products INNER JOIN "
strQ = strQ & "Categories ON "
strQ = strQ & "Products.CategoryID = Categories.CategoryID "
strQ = strQ & "WHERE (Products.Discontinued = 0) "
strQ = strQ & "ORDER BY Categories.CategoryName"
objRS.Open strQ
%>
<html>
<head><title>Products</title></head>
<body bgcolor=#ffffff>
<h1>Our product catalog</h1>
<table border=1><tr>
<th align="left">Product</th>
<th align="left">Quantity per Unit</th>
<th align="left">Price (USD)</th><th align="left">Category</th>
</tr>
<%
While Not objRS.EOF
Response.Write "<tr><td><a href=""bag.asp?id=" & objRS(0) & """>"
Response.Write Server.HtmlEncode(objRS(1)) & "</a></td>"
Response.Write "<td>" & objRS(2) & "</td>"
Response.Write "<td>" & objRS(3) & "</td>"
Response.Write "<td>" & objRS(4) & "</td>"
Response.Write "</tr>" & vbCrLf
objRS.MoveNext
Wend
objRS.close
objConn.close
Set objRS = Nothing
Set objConn = Nothing
%>
</table>
</body>
</html>