Home | Overview | How Do I | FAQ | Sample | Tutorial | ODBC Driver List
This article explains how to create a new table, with the correct format, in an external data source. For general information about external data sources, see the article DAO External: Working with External Data Sources.
To create an external table
Construct a CDaoDatabase object and call its Open member function. Pass the appropriate connection information.
You can’t manipulate the schema of an attached table, so you must open directly.
Construct a CDaoTableDef object based on the CDaoDatabase object. Call the tabledef object’s Create member function, specifying connection information and the name of the source table on which the tabledef is based.
As an alternative, you could accept the default parameter values in Create, then call SetConnect and SetSourceTableName.
Call the tabledef object's CreateField member function. The new field is automatically appended to the underlying DAO tabledef object's Fields collection.
See Also DAO: Where Is..., DAO External: Working with External Data Sources, DAO External: Attaching External Tables, DAO External: Refreshing and Removing Links