Click to See Complete Forum and Search --> : Creating an Access Database programmatically


compusoft
February 2nd, 2009, 10:35 PM
Is it possible to create an Access database in C# using ADO.NET?

ledaker
February 9th, 2009, 09:33 AM
Yes you can by adding ADOX reference and :

ADOX.CatalogClass cat = new ADOX.CatalogClass();
cat.Create("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\dbase.mdb;Jet OLEDB:Engine Type=5");

Geming Leader
April 26th, 2009, 11:41 AM
Thanks ledaker; this post provides discussion of the code you have just provided:
http://vbadud.wordpress.com/2007/11/27/create-microsoft-access-database-programmatically-using-ado/

In addition, you can query MASTER and create your database using SQL statements.