Ok. If you have Office 32 bit on a 64 bit O/S, then you're gonna have fits. Try changing the "Platform Output" to x86. Go to your project properties and find the "Build" tab. "Platform target" should be listed there.
Now, even if that works, you'll have to investigate the ramifications of that decision. But at least "you would know".
EDIT--------------
Here are your permutations. And you're gonna just have to experiment with them.
The connection string, is it right or wrong. "12" vs "14" as previously mentioned. (Sorry, the link is about Excel. Try using the suggestion from "T.S.".)
Office 32 bit being installed. I think if you tried to install "AccessDatabaseEngine_x64.exe" on that machine, it would give you a "Office version not right" error.
So because of #2, you gotta install "AccessDatabaseEngine.exe". Which is 32 bit.
The "Platform Output". Now I ~~think~~ because of #3, you need to experiment with setting it to x86.
Try putting it back to x86, and then trying the "12" vs "14" in the connection string.
EDIT-----------------
I pulled a file off the internet.
Oren.accdb from http://old.cba.ua.edu/~jomason/ac289/289AccessFiles.html
And I coded this up on my machine. And it works.
private void button1_Click(object sender, EventArgs e) { try { using (OleDbConnection connect = new OleDbConnection()) { connect.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\folder1\data\Oren.accdb;Persist Security Info=False;"; connect.Open(); OleDbCommand cmd = new OleDbCommand(); cmd.Connection = connect; cmd.CommandText = "Select * from Agreement"; StringBuilder sb = new StringBuilder(); IDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { Console.WriteLine(reader[0].ToString()); sb.Append(string.Format("{0}, {1}", reader[0].ToString(), reader[1].ToString()) + System.Environment.NewLine); } reader.Close(); ReportMessage(sb.ToString()); } } catch (System.Data.OleDb.OleDbException lolex) { ReportException(lolex); } catch (Exception ex) { ReportException(ex); } } private void ReportException(Exception ex) { txtStatus.Text = ex.Message; } private void ReportException(System.Data.OleDb.OleDbException oleex) { StringBuilder sb = new StringBuilder(); sb.Append(oleex.ErrorCode + System.Environment.NewLine); sb.Append(oleex.Message + System.Environment.NewLine ); txtStatus.Text = sb.ToString(); } private void ReportMessage(string msg) { txtStatus.Text = msg; }
EDIT
Can you open the file "storekeeper.accdb" in the program "Microsoft Access". It's not password protected is it?
InnerExceptionproperty on the thrown exception which you can examine. It will tell you what the exact error is. msdn.microsoft.com/en-us/library/…