0

I get a error with ADOX when compiling, and I don't know what's causing it.

Here is my code:

        ADOX.Catalog cat = new ADOX.Catalog();
        cat.Create("Provider=Microsoft.ACE.OLEDB.12.0;" +
            "Data Source=" + db + ";" +
            "Jet OLEDB:Engine Type=5");

        MessageBox.Show("Created database" + db + " in current directory " + cDirectory + "\n");

The error is:

The type or namespace name 'ADOX' could not be found (are you missing a using directive or an assembly reference?


How can this error be resolved?

CJBS
  • 15,147
  • 6
  • 86
  • 135
  • Please paste the error here. – Tony Oct 10 '13 at 01:13
  • Error 1 The type or namespace name 'ADOX' could not be found (are you missing a using directive or an assembly reference?) – user2758012 Oct 10 '13 at 02:59
  • Are you trying to open Access 2007 database? Maybe this article can help http://www.c-sharpcorner.com/uploadfile/e628d9/creating-retrieving-records-from-m-s-access-2007-using-oledb-in-C-Sharp-net/ – Tony Oct 10 '13 at 12:37

1 Answers1

1

Make sure that your C# project has the following COM reference defined:

Microsoft ADO Ext. 2.8 for DDL and Security

Gord Thompson
  • 116,920
  • 32
  • 215
  • 418