Select the product you need help with
How To Use ADOX from C++ to Copy an Old Jet Database File to a Newer Jet 4.0 Format DatabaseArticle ID: 321328 - View products that this article applies to. This article was previously published under Q321328 SUMMARY
This article demonstrates how to use ActiveX Data Objects Extensions for Data Definition Language and Security (ADOX) with Visual C++ to create a new Jet database using data from an older formatted Jet database.
This article also demonstrates the following techniques that are used in ADOX with Visual C++:
MORE INFORMATION
Testing the CompactDatabase method of the Jet Replication Object (JRO) reveals that the method does not efectively convert a table to Jet 4.0 format if the source table is in Access 2.0 or in Access 95 format. If a table that is generated by Access 2.0 or by Access 95 is converted to Jet 4.0 format using the CompactDatabase method of the JRO object, Access 2000 or Access 2002 cannot successfully open the database. This issue is still under investigation at Microsoft. Note that JRO objects were meant to work only with Jet 4.0 and Jet 3.5x format databases. To convert your old Jet database (earlier than Jet 3.5 format), use ADOX to create a new 4.0 format database and copy all of the tables. The following code demonstrates how to do this. This is a simple sample and does not address several special scenarios such as primary keys, indexes, properties, and relations. The sample only copies tables and does not copy other objects from the source database. For additional information about those techniques, see the ADOX documentation on the MSDN Library Web site. Save the following code in a C++ project, and then build the project: NOTE: You do not have to change anything in the code except for the paths on the #import and connection strings. REFERENCES
For more information, visit the MSDN Library at the following Microsoft Web site:
http://msdn2.microsoft.com/en-us/library/default.aspx
In the Contents tree in the left pane of the MSDN Library, browse to the following Help topic:
(http://msdn2.microsoft.com/en-us/library/default.aspx)
\Data Access
\Microsoft Data Access Components
\ADO
\SDK Documentation
\Microsoft ActiveX Data Objects (ADO)
\ADO Programmer's Guide
225048
(http://support.microsoft.com/kb/225048/EN-US/
)
INFO: Issues Migrating from DAO/Jet to ADO/Jet
304322
(http://support.microsoft.com/kb/304322/EN-US/
)
ACC2002: How to use ADOX to Import Relationships
230588
(http://support.microsoft.com/kb/230588/EN-US/
)
How To Link and Refresh Linked Jet Tables Using ADOX
279245
(http://support.microsoft.com/kb/279245/EN-US/
)
FIX: Default Column Properties Cleared When You Set or Check Values by Using ADOX to an Access Database
304323
(http://support.microsoft.com/kb/304323/EN-US/
)
ACC2002: How to Use ADOX to Create an SQL Pass-Through Query
275252
(http://support.microsoft.com/kb/275252/EN-US/
)
ACC2000: How to Create a Table with Jet Data Types via ADOX
252908
(http://support.microsoft.com/kb/252908/EN-US/
)
How To Create a Table with Primary Key Through ADOX
230501
(http://support.microsoft.com/kb/230501/EN-US/
)
How To Compact Microsoft Access Database via ADO
PropertiesArticle ID: 321328 - Last Review: August 15, 2005 - Revision: 1.4
|


Back to the top








