Click here to Skip to main content
15,176,948 members
Articles / Programming Languages / C#
Alternative
Tip/Trick
Posted 9 Nov 2010

Tagged as

Stats

7.9K views
3 bookmarked

Create a blank Jet database

Rate me:
Please Sign up or sign in to vote.
4.67/5 (2 votes)
13 Nov 2010CPOL
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) { ...
And here is the long version, provided from Microsoft:

http://support.microsoft.com/kb/317881/en-u[^]

C#
using System;
using ADOX;
namespace ConsoleApplication1
{
    class Class1
    {
        [STAThread]
        static void Main(string[] args)
        {
            ADOX.CatalogClass cat = new ADOX.CatalogClass();
            cat.Create("Provider=Microsoft.Jet.OLEDB.4.0;" +
                   "Data Source=D:\\AccessDB\\NewMDB.mdb;" +
                   "Jet OLEDB:Engine Type=5");
            Console.WriteLine("Database Created Successfully");
            cat = null;
        }
    }
}


But many thanks for the embedded version - the trick just works for all esoterism file formats we need in our projects.
And a special thanks :-O for the c style one line solution. That is a real 5 too.

License

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

Share

About the Author

snoopy001
Germany Germany
No Biography provided

Comments and Discussions

 
GeneralThis line: ADOX.CatalogClass cat = new ADOX.CatalogClass()... Pin
ZamirF24-Nov-10 12:22
MemberZamirF24-Nov-10 12:22 
GeneralReason for my vote of 1 1 Pin
Sherylee12-Nov-10 2:17
MemberSherylee12-Nov-10 2:17 
GeneralMy Solution has nothing to do with esoterics. It came from t... Pin
FZelle10-Nov-10 0:00
MemberFZelle10-Nov-10 0:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.