Database Toolbox |
|
Setting Up a Data Source for ODBC Drivers
Follow this procedure to set up a data source for a PC running Windows whose database resides on that PC or on another system to which the PC is networked via ODBC drivers. This procedure uses as an example, the Microsoft ODBC driver Version 4.00 and the U.S. English version of Microsoft Access 2000 for Windows 2000. If you have a different configuration, you may have to modify the instructions.
To set up the data source:
- Close the database in the database program. For the examples, if Microsoft Access is open, be sure to close the databases
tutorial.mdb
and Nwind.mdb
.
- From the Windows Start menu, select Settings -> Control Panel -> Administrative Tools -> Data Sources (ODBC).
- The ODBC Data Source Administrator dialog box appears, listing any existing data sources.
- Select the User DSN tab.
- A list of existing user data sources appears.
- Click Add. A list of installed ODBC drivers appears in the Create New Data Source dialog box.
- Select the ODBC driver that the local data source you are creating will use and click Finish.
- For the examples in this book, select Microsoft Access Driver (*.mdb).
- Otherwise, select the driver for your database.
- The ODBC Setup dialog box appears for the driver you selected. Note that the dialog box for your driver might be different from the following.
- Provide a Data Source Name and Description.
- For the first sample data source, type
dbtoolboxdemo
as the data source name.
For some databases, the ODBC Setup dialog box requires you to provide additional information.
- Select the database that this data source will use. Note that for some drivers, you skip this step.
- In the ODBC Setup dialog box, click Select.
- Find and select the database you want to use. For the
dbtoolboxdemo
data source, select tutorial.mdb
in
$matlabroot\toolbox\database\dbdemos
.
-
If your database resides on another system to which your PC is connected, you must first click Network in the Select Database dialog box. The Map Network Drive dialog box appears. Find and select the directory containing the database you want to use, and then click Finish. The Map Network Drive dialog box closes.
- Click OK to close the Select Database dialog box.
- In the ODBC Setup dialog box, click OK.
- Repeat steps 4 through 8 to set up the data source for the other example database,
Nwind
.
- In step 6, type
SampleDB
as the data source name.
- In step 7, select
Nwind.mdb
.
- Click OK to close the ODBC Data Source Administrator dialog box, which now contains the
dbtoolboxdemo
and SampleDB
data sources.
| Setting Up a Data Source | | Setting Up a Data Source for JDBC Drivers | |
© 1994-2005 The MathWorks, Inc.