4

I want to create Ms access2007 file programatically from c# using Microsoft.ACE.OLEDB.12.0

1
  • It's nice to know what you want to do. A proper question would explain what it is you actually need help with, including what you've already tried that doesn't work, etc. Commented Jan 13, 2011 at 2:33

1 Answer 1

4

Here is some example:

    using System;
    using ADOX;

    namespace ConsoleApplication1
    {
        class Class1
        {
            [STAThread]
            static void Main(string[] args)
            {
                ADOX.Catalog cat = new ADOX.Catalog();

                cat.Create("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\myFolder\myAccess2007file.accdb;");

                Console.WriteLine("Database Created Successfully");

                cat = null;

            }
        }
    }
Sign up to request clarification or add additional context in comments.

4 Comments

Thanks for the answer Build I have already try it and i got the message: "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done." My code : ADOX.CatalogClass cat = new ADOX.CatalogClass(); cat.Create("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\Tmp.accdb;Persist Security Info=False;");
Oh yahhh I Resolve it cat.Create("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\myFolder\myAccess2007file.accdb;;Jet OLEDB:Engine Type=5;"); Thanks any way
Sorry for inconvinience, I also have made some changes to my code, so that it is work properly.
<Microsoft ADO Ext. 6.0 for DDL and Security> for ADOX

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.