How to create a new Access database, table, and field using CDaoDatabase, CDasoTableDef 
Author Message
 How to create a new Access database, table, and field using CDaoDatabase, CDasoTableDef

Hi!
I would like to know how to use CDaoDatabase, CDaoTableDef to create a
new Access database (.mdb), table, and field. From MSDN Library, I
know how to create a new database.

#include <afxado.h>

CDaoDatabase* p_db;
p_db = new CDaoDatabase;

p_db->Create("test.mdb", dbAttachExclusive);

<Add code here to create a new table>

p_db->Close();
delete p_db;

Though the above program doesn't work perfectly under debug mode, it
works OK for me under release mode. Now, my question is how to use
CDaoTableDef class to create a new table in the new database. Can
someone show me what I have to add in the above program. Thanks in
advance!

Ying-Gu Yang

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
_/  Ying-Gu Yang

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/



Mon, 08 Mar 2004 14:43:24 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Creating tables in an access database using ODBC???

2. Creating Access 2000 Database with CDaoDatabase

3. Creating a table from VC++ using stored in Access import/export table specification

4. Creating a new field in an exiting table at a certain position

5. Creating new database and tables with MFC VC++6

6. creating new table in database

7. Using ADO to create/delete tables & fields

8. using multiple tables in a single access database

9. Creating Database/Tables using ADO

10. Howto: Create Access OLE fields using MFC

11. Create table(Not a database table)

12. Create table(Not a database table)

 

 
Powered by phpBB® Forum Software