An Example in RDS

Example 11-1 displays the entire Orders table of the Northwind database in a table within an ASP page. To run this example, create an ASP page and replace the entire contents of the page with the following code. Make sure that this ASP page is within a virtual directory of your web server, such as RDSExample. To execute this page, go to Internet Explorer and type in the full URL to the ASP -- for example, http://servername/RDSExample/example.asp.

Example 11-1. Displaying a Table with RDS
<%@ Language=VBScript %> <html> <head> <title>RDS Code Example</title> </head> <body> <h1>RDS Code Example</h1> <H2>Orders Table</H2> <P> <INPUT TYPE=button NAME="View" VALUE="View"> <SCRIPT Language="VBScript"> <!-- Sub View_OnClick ' ' connect to the server and query ' OrderTable.Server = "http://JROFF-LAPTOP/" OrderTable.SQL = "SELECT * FROM Orders;" OrderTable.Connect = "DRIVER={SQL SERVER}; " _ & "SERVER=JROFF-LAPTOP; " _ & "DATABASE=Northwind; " ' ' set the filter ' OrderTable.FilterColumn = "Freight" OrderTable.FilterCriterion = ">=" OrderTable.FilterValue = "20.00" ' ' set the sort order ' OrderTable.SortColumn = "Freight" OrderTable.SortDirection = False ' ' populate ' OrderTable.Refresh End Sub --> </SCRIPT> &nbsp;</P> <TABLE DATASRC=#OrderTable align=left border=1 style="LEFT: 11px; TOP: 115px"> <TBODY> <TR> <TD><SPAN DATAFLD="OrderID"></SPAN></TD> <TD><SPAN DATAFLD="ShipName"></SPAN></TD> <TD><SPAN DATAFLD="Freight"></SPAN></TD> </TR> </TBODY> </TABLE> <P> <OBJECT ...

Get ADO: ActiveX Data Objects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.