Creating tables in an access database using ODBC??? 
Author Message
 Creating tables in an access database using ODBC???

Hello,

In my MFC code (using ODBC) I have two objects:

CMyRecordSet vMyRecordSet;
CDatabase vMyDatabase; /*an Access 2000 database*/

I create a table:

vMyDatabase.ExecuteSQL("CREATE TABLE MyTable ([First Field] CHAR(10));
and I immediately add a record:
vMyRecordSet->Addnew();
vMyRecordSet->DB_First = "1";
vMyRecordSet->Update();

Now when I try to read the contents of the newly created record of the newly
created table my program reads the number one and a lot of spaces??? What
did I do wrong in my code???

Is it the Access 2000 database, did I create the table in a wrong manner???

Please help me,

Johan Machielse



Mon, 10 Mar 2003 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. How to create a new Access database, table, and field using CDaoDatabase, CDasoTableDef

2. Strange ODBC errors using DAO to access linked tables in Access .MDB

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

4. Attaching an ODBC database table using DAO

5. Updating or Inserting into an Access 97 table using ODBC

6. Lock Access Tables using ODBC in VC++

7. Is it possible to access Visual FoxPro5.0 tables directly from VC++ MFC(without using ODBC)

8. creating a relationship in Access database with ODBC

9. using multiple tables in a single access database

10. Creating Database/Tables using ADO

11. Date conversion from Microsoft Access using ODBC with mfc Database Object

12. Accessing database with CGI in C/C++ using ODBC

 

 
Powered by phpBB® Forum Software