Click here to Skip to main content
Click here to Skip to main content
Alternatives (5)

Create a blank Jet database

, 13 Nov 2010
How to create a blank Jet database

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

7 Nov 2010
FZelle
You can do this in a much easier way:object ADOXCat = Activator.CreateInstance(Type.GetTypeFromProgID("ADOX.Catalog"));ADOXCat.GetType().InvokeMember("Create", System.Reflection.BindingFlags.InvokeMethod, null, ADOXCat, new string[] { ConnectionString });
18 Nov 2010
Diamonddrake
another way is to first create a empty db in access then read its bytes into an array and export them as a string. Then hardcode that string into a class that creates the the empty database by converting the hardcoded string back into a byte array and then writing it to disk as a mdb...
23 Nov 2010
ISanti
I like to use the old JET API to manipulate ACCESS Databases.In C# 4 all you need to create a blank JET database is add a reference to Microsoft.Office.Interop.Access.Dao library in your WINDOWS FORMS project, and two simple lines of code: var engine=new DBEngine(); var...
13 Nov 2010
snoopy001
And here is the long version, provided from Microsoft:http://support.microsoft.com/kb/317881/en-u[^]using System;using ADOX;namespace ConsoleApplication1{ class Class1 { [STAThread] static void Main(string[] args) { ...
26 Nov 2010
ZamirF
This line:ADOX.CatalogClass cat = new ADOX.CatalogClass();may not work if you are using C# 4.0+You will needADOX.Catalog cat = new ADOX.Catalog();For a completed method checkout:http://zamirsblog.blogspot.com/2010/11/creating-access-database.html[^]

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Walt Fair, Jr.
Engineer Comport Computing
United States United States
Walt has been playing with software since around 1967 and has generated more runtime errors than the average village idiot. He is a CEO, Petroleum Engineer, software consultant, janitor, and now a graduate student again. Rather than sleep, he also plays with algorithms and systems for technical computing, develops software for engineering evaluations and is an avid amateur radio operator.
 
Walt was admitted back to UT Austin and is actually attempting to complete a PhD in engineering, thereby proving that he is crazier than the average old fart.
 
And now UT has gone and admitted Walt to PhD candidacy, proving that old guys can still ... what was he doing again?

| | Privacy | Mobile
Web03 | 2.8.140721.1 | Last Updated 13 Nov 2010
Article Copyright 2010 by Walt Fair, Jr.
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid