Article ID: 317867 - Last Review: May 16, 2007 - Revision: 4.3 How to create a Microsoft Access database by using ADOX and Visual Basic .NETThis article was previously published under Q317867 Caution ADO and ADO MD have not been fully tested in a Microsoft .NET Framework environment. They may cause intermittent issues, especially in service-based applications or in multithreaded applications. The techniques that are discussed in this article should only be used as a temporary measure during migration to ADO.NET. You should only use these techniques after you have conducted complete testing to make sure that there are no compatibility issues. Any issues that are caused by using ADO or ADO MD in this manner are unsupported. For more information, see the following article in the Microsoft Knowledge Base: 840667
(http://support.microsoft.com/kb/840667/
)
You receive unexpected errors when using ADO and ADO MD in a .NET Framework application On This PageSUMMARY Programmers may have to create databases programmatically,
but neither ActiveX Data Objects (ADO) nor ADO.NET provides the means to create
Microsoft Access databases. However, you can create Access databases by using
the Microsoft Jet OLE DB Provider and Microsoft ADO Ext. 2.7 for DDL and
Security (ADOX) with the COM Interop layer.
Requirements
Steps to Build Example
TroubleshootingThe Jet Provider requires that the path exists to create the new database. If you try to create a database file in a path that does not exist, you receive an exception. This exception can be caught by using a try...catch structure.REFERENCESFor additional information about how to create a table with a primary key through ADOX, click the following article number to view the article in the Microsoft Knowledge Base: 252908
(http://support.microsoft.com/kb/252908/EN-US/
)
HOWTO: Create a Table with Primary Key Through ADOX
For more details about the .NET Framework and the
COM Interop layer, visit the following Microsoft Web site:Exposing COM Components to the .NET Framework http://msdn2.microsoft.com/en-us/library/z6tx9dw3(vs.71).aspx
(http://msdn2.microsoft.com/en-us/library/z6tx9dw3(vs.71).aspx)
For more details about Microsoft Jet 4.0 Engine Type values,
visit the following Microsoft Web site:Appendix A: Microsoft OLE DB Provider for Microsoft Jet http://msdn.microsoft.com/en-us/library/ms810660.aspx
(http://msdn.microsoft.com/en-us/library/ms810660.aspx)
| Article Translations
|
Back to the top
