CDaoTableDef::Create

virtual void Create( LPCTSTR lpszName**,long** lAttributes**= 0, LPCTSTR** lpszSrcTable**= NULL, LPCTSTR** lpszConnect**= NULL );**
throw( CDaoException, CMemoryException );

Parameters

lpszName

A pointer to a string containing the name of the table.

lAttributes

A value corresponding to characteristics of the table represented by the tabledef object. You can use the bitwise-OR to combine any of the following constants:

Constant Description
dbAttachExclusive For databases that use the Microsoft Jet database engine, indicates the table is an attached table opened for exclusive use.
dbAttachSavePWD For databases that use the Microsoft Jet database engine, indicates that the user ID and password for the attached table are saved with the connection information.
dbSystemObject Indicates the table is a system table provided by the Microsoft Jet database engine.
dbHiddenObject Indicates the table is a hidden table provided by the Microsoft Jet database engine.

lpszSrcTable

A pointer to a string containing the source table name. By default this value is initialized as NULL.

lpszConnect

A pointer to a string containing the default connect string. By default this value is initialized as NULL.

Remarks

Call this member function to create a new saved table. Once you have named the tabledef, you can then call Append to save the tabledef in the database’s TableDefs collection. After calling Append, the tabledef is in an open state, and you can use it to create a CDaoRecordset object.

For more information on tabledefs, see the articles and in Visual C++ Programmer's Guide. For related information, see the topic "CreateTableDef Method" in DAO Help.

CDaoTableDef OverviewClass MembersHierarchy Chart

See Also   CDaoTableDef::Open, CDaoTableDef::Close, CDaoRecordset