Defining the Datasource

Like all databases that are accessed with IDC, the bookstore database must be an ODBC datasource defined in the ODBC Administrator. Additionally, the datasource must be a system DSN. Create the system DSN by following the steps below.

Step 1

From the Control Panel or an ODBC group, start the ODBC Administrator. When the ODBC Administrator starts, you will see the Data Sources dialog box.

Step 2

Install the new datasource by clicking on the System DSN button in the Data Sources dialog box. The System Data Sources dialog box should appear. In the System Data Sources dialog box, click on the Add button. The Add Data Source dialog box will then appear.

Step 3

In the Add Data Source dialog box, select the Microsoft Access ODBC driver and click on the OK button. The ODBC Microsoft Access Setup dialog box should appear. This dialog box is used to set up the datasource.

Step 4

Give your datasource a name by typing bookstore into the Data Source Name text box. This is the name you will use to identify the database whenever you utilize an ODBC driver. This name can be anything you want and is not directly related to the name of the database you copied from the companion CD.

Step 5

Enter a brief description for your datasource in the Description text box. This can be any text you want and has no effect on the application.

Step 6

Establish your datasource as the database you copied previously by clicking on the Select button. Now you will see a dialog box that lets you select the file for this datasource. Navigate to the \bookdata\project3 folder in which you copied the database and select bookstor.mdb. Figure 8-3 shows a sample of the ODBC Microsoft Access Setup dialog box after the bookstor.mdb database has been set up. When you are done, click on the OK button. Your new datasource should now be visible in the System Data Sources dialog box.

Figure 8-3.

The ODBC Microsoft Access Setup dialog box after the bookstor.mdb database has been set up.

Step 7

Click on the Close buttons in the System Data Sources dialog box and the Data Sources dialog box to exit the ODBC Administrator. Your datasource is now ready to be accessed from the web!

© 1996 by Scot Hillier. All rights reserved.