What Data Sources Can I Access with DAO and ODBC?

OverviewHow Do IFAQ

Both sets of MFC classes let you access a wide variety of data sources and make it possible to write applications that are independent of the data source.

Databases You Can Access with DAO

Using DAO and the MFC DAO classes, you can access the following sources of data:

  • Databases using the Microsoft Jet database engine, created with Microsoft Access or Microsoft Visual Basic, versions 1.x, 2.x, and 3.0 of the database engine

  • Installable ISAM databases, including:

    • Microsoft FoxPro, versions 2.0, 2.5, and 2.6. Can import/export data to and from version 3.0, but can’t create objects

    • dBASE III, dBASE IV, and dBASE 5.0

    • Paradox, versions 3.x, 4.x, and 5.x

  • Open Database Connectivity (ODBC) databases, including but not limited to Microsoft SQL Server, SYBASE® SQL Server, and ORACLE® Server. To access an ODBC database, you must have an appropriate ODBC driver for the database you wish to access. See the article ODBC Driver List for a list of ODBC drivers included in this version of Visual C++ and for information about obtaining additional drivers.

  • Microsoft Excel, versions 3.0, 4.0, 5.0, and 7.0 worksheets

  • Lotus WKS, WK1, WK3, and WK4 spreadsheets

  • Text files

DAO is best used with databases that the Microsoft Jet database engine can read. That includes all of the above except ODBC data sources. Best performance is with Microsoft Jet (.MDB) databases. Attaching external tables, especially in ODBC data sources, to an .MDB database is more efficient than opening the external database directly via the MFC DAO classes without attaching. For more information on external data sources, see the article DAO External: Working with External Data Sources.

Databases You Can Access with ODBC

Using ODBC and the MFC ODBC classes, you can access any data source, local or remote, for which the user of your application has an ODBC driver. Both 16-bit and 32-bit ODBC drivers are available for a wide range of data sources. If you're working with a Microsoft Jet (.MDB) database, it's more efficient to use the DAO classes than the Microsoft Access ODBC driver.