home *** CD-ROM | disk | FTP | other *** search
- <html>
-
- <head>
- <meta name="GENERATOR" content="Microsoft FrontPage 3.0">
- <title>Northwind DataBase Demo</title>
-
- <meta name="Microsoft Theme" content="none, default">
- </head>
-
- <body>
-
- <h1>Northwind Employee Roster</h1>
-
- <p><big>The following list is generated dynamically using an ASP script which queries an
- ODBC database. </big></p>
- <!-- start the table to wrap around the data -->
- <div align="center"><center>
-
- <table border="1">
- <%
- 'Create a connection object
- Set cn = Server.CreateObject("ADODB.Connection")
-
- 'Open a connection; the string refers to the DSN
- cn.Open "FILEDSN=My_Development_DB.dsn"
-
- 'Instantiate a Recordset object
- Set rsCustomers = Server.CreateObject("ADODB.Recordset")
-
- 'Open a recordset using the Open method
- ' and use the connection established by the Connection object
- strSQL = "SELECT * FROM Employees"
- rsCustomers.Open strSQL, cn
-
- 'Cycle through record set and display the results
- ' and increment record position with MoveNext method
- Set objFirstName = rsCustomers("FirstName")
- Set objLastName = rsCustomers("LastName")
-
- Do Until rsCustomers.EOF
- Response.Write "<tr><td bgcolor='#C0C0C0'>"
- Response.Write objFirstName & " " & objLastName & "</td></tr>"
- rsCustomers.MoveNext
- Loop
-
- 'Close the DB connection
- cn.Close
-
- %>
- </table>
- </center></div>
-
- <p><big>Note that adding the HTML to display the results is the programmers responsibility</big></p>
- </body>
- </html>
-