ADOX Exception: Class not Registered

0

I'm trying to create a database in C# using a Windows Forms App in Visual Studio 2017. No matter what I try, I'm getting the same error. I know everyone says it's an x64 thing, but I've set my platform to x86.

Here's the error

System.Runtime.InteropServices.COMException
  HResult=0x80040154
  Message=Class not registered
  Source=Ex3
  StackTrace:
   at ADOX._Catalog.Create(String ConnectString)
   at Ex3.FmMenu.FmMenu_Load(Object sender, EventArgs e) in C:\Users\benjo\Apps\CS\CSharp\Ex3\Ex3\FmMenu.cs:line 26
   at System.Windows.Forms.Form.OnLoad(EventArgs e)
   at System.Windows.Forms.Form.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

And here's the code I'm trying to get to work, the error occurs on the first line

new ADOX.Catalog().Create(Program.ConnString);
OleDbConnection Conn = new OleDbConnection(Program.ConnString);
Conn.Open();
OleDbCommand Cmd = new OleDbCommand();
Cmd.Connection = Conn;

Everyone says I should try setting my program to run in 32-bit mode, but that hasn't changed anything

c#
visual-studio
visual-studio-2017
adox
asked on Stack Overflow Apr 26, 2018 by Ben • edited Apr 26, 2018 by Kzrystof

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0