Create Microsoft Access Database Programmatically (VB.NET/ASP.NET)

Category:
C#, VB.NET, ASP.NET
Type:
Snippets
Difficulty:
Beginning
Author:
Pankaj Banga

Version Compatibility: Visual Basic.NET, ASP.NET

More information:
Neither ADO.NET nor ActiveX Data Object (ADO) provides the means to create Microsoft Access Database. However, we 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. To do so, select References from the Project Menu, choose the COM tab, and add a reference to Microsoft ADO Ext. 2.7 for DDL and Security; then you can use this function.

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: