3

I am trying to use an access database to create a login for a Hotel reservation system in C#, unfortunately I have run into a problem with the following error;

The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.

Most of the research I done with this was that people did not have Access installed on their machines. But as I do have it installed and still get this problem I am getting very confused over this. If anyone has any suggestions or solutions to this I would be grateful!

I am using a file reader class and for any of the methods in the class it always displays the error at the "Conn.Open()" command, here is my code for one of the methods.

public DataTable LoadLogin() { string connString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=F:"Not getting my connection string :p"; DataTable results = new DataTable();

        using (OleDbConnection conn = new OleDbConnection(connString))
        {
            OleDbCommand cmd = new OleDbCommand("SELECT User_Name, Password FROM Employee", conn);
            conn.Open();


            OleDbDataAdapter adapter = new OleDbDataAdapter(cmd);
            adapter.Fill(results);


        }
        return results;

    }
13
  • Does your app targets 64 bits? Commented Mar 21, 2014 at 20:16
  • 2
    Have you looked at this ? : social.msdn.microsoft.com/Forums/en-US/… Commented Mar 21, 2014 at 20:17
  • As far as I remember, it means that you have to install that package Commented Mar 21, 2014 at 20:18
  • 1
    What bitness is your office and what bitness is your code? x64 or x86... dollars to doughnuts says this is a bitness mismatch Commented Mar 21, 2014 at 20:21
  • I have installed that and it did not work Commented Mar 21, 2014 at 20:23

1 Answer 1

3

This is likely due to the fact that you are compiling and running 32-bit, but are using the 64-bit Access driver. The other possibility is that you have the 32-bit version of Access installed in which case you need to compile and run your program for x86 using "Microsoft.Jet.OLEDB.4.0" as your provider string.

Unfortunately, you can't mix-and-match the bitness of your program with the bitness of the Access provider you are using.

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.