Home | Overview | How Do I | FAQ | Sample | Tutorial | ODBC Driver List
This article describes "tabledefs" and the key features of the MFC CDaoTableDef class. Additional articles explain how to use tabledefs. For task-oriented information, see the article DAO Tabledef: Using Tabledefs. For an understanding of the DAO tabledef object underlying each MFC CDaoTableDef object, see the topic "TableDef Object" in DAO Help.
Topics covered include:
A DAO tabledef, represented in MFC by a CDaoTableDef object, is an object that defines the structure of a base table or an attached table.
A base table is a table in a Microsoft Jet (.MDB) database. You can manipulate the structure of a base table using DAO objects or data definition language (DDL) SQL statements, and you can use recordsets and action queries to modify data in a base table.
An attached table is a table in another database linked to a Microsoft Jet (.MDB) database. Data for attached tables remains in the external database where it may be manipulated by other applications. You can't use the table-type recordset with attached tables, and you can’t modify the schema of attached tables, but you can use dynaset-type and snapshot-type recordsets with attached tables.
The main use for tabledef objects is to manipulate the structure of a table. You can:
You can use tables as the basis for opening recordsets in two ways. You can:
For a complete discussion of what you can do with tabledefs, see the topic "TableDef Object" in DAO Help.
Each DAO database object maintains a TableDefs collection — a collection of all saved table definitions in the database. The collection contains one tabledef for each table in the database. Each tabledef object maintains two collections of its own:
MFC objects don't store a representation of a DAO collection. Instead, MFC accesses the collection through the underlying DAO object. For more information, see the article DAO Collections.
MFC also doesn't provide a C++ class to represent every DAO object. In particular, there is no MFC field object or index object. You work with a tabledef's fields and indexes through member functions of class CDaoTableDef.
For more information about tabledefs in MFC, see the following additional articles (in the order listed here):
General Tabledef Article
Tables in External Data Sources
See Also DAO: Where Is..., DAO Querydef, DAO Recordset, DAO Database