Setting Up and Running the Online Catalog Sample Application
The Online Catalog Sample Application uses any major web browser for its client piece, IIS as the Web Server, and SQL Server as the database.
The following sections describe the steps necessary to set up the environment for running the sample application:
NOTE: These instructions are designed to get the sample applications up and running: they should not be used as a guide to good database practices in a production environment.
Hardware Requirements You need to verify that you meet the following hardware requirements:
Setup SQL Server Database
This section outlines how to run the self-extracting DBSetup.exe file and the commands used to create the physical directories for your database, the database itself, the tables and stored procedures, and then loads the domain table data.
NOTE: The MDAC SDK installs two self-extracting exe files used to setup an SQL Server database and an IIS server with the files necessary to run this sample. When you run these self-extracting exe files, they decompress a set of files into the directory “MDAC Samples” on your C: drive. These files, DBSetup.exe and WebSetup.exe, are located where you installed the MDAC SDK in the Samples\MDAC directory. The default is C:\MSDASDK\Samples\MDAC.
The DBSetup.exe file sets up the SQL Server database. You need to extract this file on the machine running SQL Server, or on the client machine with the SQL Server client software installed.
The Websetup.exe file sets up the IIS server with the sample web files. You need to run this file on the system running the IIS server.
If the machine running either SQL Server or the IIS server is different than the machine you installed the MDAC SDK on, simply copy the appropriate exe to that machine.
-
If needed, copy the file DBSetup.exe to the machine running SQL Server, or a machine that has the client SQL Server software installed.
-
Run the DBSetup.exe file. The program will extract the database setup files to the directory “C:\MDAC Samples\Database” In addition, the program creates several subdirectories underneath this directory. You can remove these files and subdirectories after the database has been setup.
-
Open an MS DOS window and change to the directory where you extracted the database setup files. Change to the bat subdirectory under “C:\MDAC Samples\Database”. This directory contains all the batch files to run. These batch files use the following parameters:
-
Create the database devices by entering the following in the MS DOS window:
makedev ServerName AdminUserID Password
Two acknowledgement messages appear: Data device created, and Log device created. If you get the following error message: “The name specified is not recognized as an internal or external command, operable program or batch file”, it could mean that SQL Server, or the client software, is not installed propertly on your system. In order to complete properly, the SQL Server software ISQL.EXE must be available on the system.
This step creates the directory MDACsql off the root c:\driver with the subdirectories data and logs. The data device is 10 mg in size, the logs device is 5 meg.
Any errors encountered are added to a log report. You can identify these files by the .LOG extension with the same name as the command used (in this case MAKEDEV.LOG). Check this file to see if any errors occurred.
NOTE: If you want to create these devices somewhere else, you need to modify the makedev.sql file. Search for "@vc_device_UNC" which defines the paths of the devices.
-
Create the database by entering the following in the MS DOS window:
createdb ServerName AdminUserID Password
Several acknowledgement messages appear. Check CREATEDB.LOG for any errors.
-
Set up the contents of the database by entering the following in the MS DOS window:
setupdb ServerName AdminUserID Password
This step does the following:
-
Creates the tables and should complete with no messages or errors
-
Creates the stored procedures and should complete with “Creating stored Procedures” message and no errors
-
Creates database logons and users with their permissions set, and should complete with several acknowledgement messages, and no errors
-
Loads tables with data and should complete with several acknowledgement messages, and no errors
Web Server Setup
This section outlines how to run the self-extracting Websetup.exe file to extract the sample web pages, and how to set up your IIS Web server to run the samples.
-
If needed, copy the file WebSetup.exe to the machine running your IIS 4.0 server.
-
Run the WebSetup.exe file. The program will extract the web pages to the directory “C:\MDAC Samples\OnlineCatalog”. After they are extracted, if you wish to move them to a different directory, you can simple copy the directory elsewhere.
-
Start Internet Service Manager (Start -> NT 4.0 Option Pack -> Microsoft Internet Information Server -> Internet Service Manager).
-
In the window that appears, click on the Internet Information Server node to open it.
-
Click on the [Server Name] node to open it.
-
Enable Anonymous Access:
-
Right-click on Default Web Site and select Properties.
-
Click the Directory Security tab in the dialog box.
-
Click the Edit button in the Anonymous Access and Authentication Control panel.
-
Click on the Allow Anonymous Access check box, then click the OK button.
-
Click the OK button to exit the Properties dialog Box.
-
Set the virtual directories for the sample Order Entry application:
-
Right-click on Default Web Site -> New -> Virtual Directory.
-
In the Alias to be used to access virtual directory text box, enter:
OnlineCatalog
Click the Next button.
-
Enter the physical path where the extracted files reside. The extract program places them in “C:\MDAC Samples\OnlineCatalog”. If you copied them elsewhere, specify the new location. Or you can find and select it by clicking the Browse button, and click NEXT.
-
Click on the Allow Access check boxes for Read, Script, and Execute permission. Click the Finish button.
-
Set the Default Document:
-
Right-click on Default Web Site and select Properties.
-
Click the Document tab in the dialog box.
-
Click on the Enable Default Document check box. Click the Add Button and enter Default.asp (if not already present). Click the OK button.
-
Restart the W3 Service:
-
Select Default Web Site.
-
Click the Stop icon (the black square in the tool bar).
-
When the Service stops, the black square is no longer bold, click on the Start icon, (the triangle).
Run the Sample App
To run the application, start up your browser and type in the following:
http://ServerName/OnlineCatalog
The Sample Application's homepage appears. All the Domain tables have data entered, except for Customers and Orders. You can now start browsing the Catalog, entering Customer Profile information, making Orders, and checking Order Status.
Troubleshooting
You may want to undo the installation for any number of reasons: insufficient disk space, changing path names, or interrupted installation. In all cases, follow the steps below. Since you may be backing out an incomplete install, start with the last step that you got to.
-
Using the Microsoft Management Console, delete the OnlineCatalog virtual directory under the “Default Web Site Node”.
-
Using the Microsoft Management Console, stop the Web Service and restart it again: this will release any hold the IIS Server had on the file system directories and files where the web pages reside;
-
Start Enterprise Manager (Start -> Programs -> SQL Server 6.5 -> Eneterprise Manager).
-
Open the appropriate server by clicking on its name.
-
Delete the Sample database:
-
Open the Databases node by clicking on it.
-
Right click on it, and click Refresh
-
Delete the database by right clicking on the database name (MDAC20Samples), and selecting Delete.
-
Delete the database logical devices:
-
Open the Database Devices node.
-
Right click on the Database Devises tab and select Refresh. If the ADO20Samples_log1 file or ADO20Samples_data1 file exists, select and delete them.
-
Delete the physical files that make up the Database Devices by starting Windows NT Explorer and deleting c:\MDACsql. This deletes the data and logs subdirectories.
-
Delete the sample logon:
-
Open the Logins node by clicking on it.
-
Right-click SampleUser and select Drop.
-
Delete the directory “C:\MDAC Samples\Database”. Do likewise with the web pages directory “C:\MDAC Samples\OnlineCatalog” (make sure any DOS boxes that might be referencing these directories are closed. This deletes all scripts decompressed from the exe files.
You are now ready to make any needed changes to the scripts (device or directory names, etc), and repeat the install process.