The Adventure Works sample Web site is based on a fictitious company that sells outdoor equipment on-line. It is a shopping cart type of Web application that enables customers to view the products, order items, track sales, show advertisements, and do some personalization. The Adventure Works sample Web site shows how to use many Active Server Pages capabilities, including Visual Basic Scripting Edition (VBScript), built-in objects, and all the provided server components. Becoming familiar with the Adventure Works sample Web site is great way to learn about Active Server Pages because it shows how the elements can be used together to create a real Web application.
The Adventure Works sample Web site uses a Microsoft Access database to store and retrieve product information, order information, and user information. You can make the site work with Microsoft SQL Server by creating the necessary tables and stored procedures in a SQL Server database. A script file is provided to create the necessary objects in SQL Server. Perform the following steps to make the Adventure Works sample site work with Microsoft SQL Server:
isql -SServer_Name -Usa -P -iadvworks.sql
Advworks.sql is located in the root directory of the Adventure Works sample site (c:\InetPup\ASPSamp\Advworks by default). The script creates a new login and user called "AdvWorks" as the owner of the tables to make it easier to keep track of the tables used for Adventure Works. Seven stored procedures and eight tables will be created.
Select SQL Server as your data source by performing one of the following steps:
You can keep the existing AdvWorks DSN and associate it with the SQL Server ODBC driver instead of the Access ODBC driver. From the ODBC applet in the Control panel, remove the ODBC System DSN called AdvWorks and recreate it using the SQL Server ODBC driver. Be sure to call it AdvWorks and to specify the name of the SQL Server where you installed the tables in step 1.
Alternatively, you can keep the existing AdvWorks datasource for Access and use the ODBC applet in the Control panel to create a new System DSN called AdvWorks for SQL Server . After you have created the new System DSN, use a text editor to open the file Global.asa in the root directory of the Adventure Works sample (c:\InetPup\ASPSamp\Advworks by default), and search for the following line:
Conn.Open "Advworks", "Advworks", "Advworks"
Replace the line with the following text:
Conn.Open "Advworks for SQL Server", "Advworks", "Advworks"
The site was developed in such a way so that no other changes are necessary. However, certain optimizations for SQL Server are noted in comments of some asp files (such as GetCustomer.asp).
© 1996 Microsoft Corporation. All rights reserved.