Defining the Datasource

At this point in the exercise, you should have built the database by using either the Data Manager or Microsoft Access. Regardless of which method you used, your database should have the structure shown in Table 7-1 (page 243). If your database is ready, you can go on to create the ODBC datasource used in the exercise. Make sure that the database is complete and that the appropriate ODBC drivers have been installed.

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 eventreg 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 created previously.

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 created 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\project2 folder, select the eventreg.mdb database you created previously, and click the OK button. Figure 7-5 shows a sample of the ODBC Microsoft Access Setup dialog box after the eventreg.mdb database has been set up. When you are done, click the OK button. Your new datasource should now be visible in the System Data Sources dialog box.

Figure 7-5.

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

Step 7

Click on the Close buttons in the System Data Sources dialog box and in 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.