-1

I am a student taking an introductory programming course and am having some issues with access databases. I use Visual Studio 2010 Professional and Microsoft Office 2013 Developers Preview (being poor college student is my reason for using the preview).

Every time I go to make a database connection inside Visual Studio (our professor is introducing us to database concepts) I navigate through to where I select create a new data connection, I select Microsoft Access Database File as the data source and the .NET Framework Provider for OLE DB as the data provider (the file is a .accdb, filename: Northwind sales web database).

I continue to the next screen, browse for the databse file and select it and then select test connection and receive the error message

"Unrecognized database format 'C:\Users\Isaiah\Documents\Northwind sales web database.accdb'."

I did a little research and found some people had this issue with office 2007 and 2010 and were able to fix it by installing "Microsoft Access Database Engine 2010 Redistributable" and/or the "2007 Office System Driver: Data Connectivity components".

I have tried both.
When installing the 2010 Redistributable I will no longer recieve the unrecognized database format error but will instead recieve the error

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

Some people who have this error have found installing the 2007 Office System Driver on top of the 2010 Redistributable will solve their issue,
I tried this and all it does is cause me to receive the old error message again.
I have tried installing one file and not the other to see if it makes a difference, it does not, no solution appears. Some people have found that ensuring they are set to compile for x86 systems solves this, it does not for me.

I am running windows 8 64-bit and also had this issue when running windows 7 64-bit.
Please help me as I am running out of ideas and am going to start to fall behind the class if I do not get my system in working order.

Any thoughts greatly appreciated

4

1 回答 1

2

For which platform do you compile your application? Usually you have two options: x86 and AnyCPU. If you compile for AnyCPU then your code is executed as 64bit code on 64bit systems or 32bit code in 32bit systems. If you compile for x86 then your code is executed always as 32bit code in 32bit and 64bit systems. So AnyCPU seems to be the obvious choice. Now imagine the Microsoft Team that develops the "Microsoft Access Database Engine 2010 Redistributable". They choose to build separate versions of their drivers. The result is: if you build for AnyCPU and run on a 64bit system where there is installed a 32bit version of the Engine you can't use their code. You need to install the 64bit version, but now you face the need to install the 64bit version of Office otherwise you can't work with that. Much better to switch your app to 32bit code and choose the x86 target platform. (And no, you can't install both versions on the same machine)

于 2013-02-22T18:18:26.960 回答