Try this:
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:\\test.accdb;");
Console.WriteLine("Database Created Successfully");
cat = null;
}
}
}
I would avoid the Activator and setting through reflection if you don't need to. I think the error you are getting is because it's trying to create a connection with a lot of properties set on a database that doesn't exist. You need to simplify your connection string, then when you want to open it you can use the rest of the properties.