问题
I have developed a small crystal reports win forms application that connects to an Access DB in the local network and shows a set of basic reports.
I used VS 2010 for this.
I used the 'DAO' connectivity method to access the DB in the VS 2010 Database expert option (Yes, Its all done in the GUI). It works all fine and dandy in my 32 bit dev machine and an Win XP VM machine that i tested it on.
However, I setup the reports on a Win 7 64bit PC and I get this error.
These are the installations I made on the 64bit Win 7 PC:
- SAP Crystal Reports runtime engine for .NET Fx 4 (64-bit)
- .NET Framework 4 Client profile (x86 & x64)
What I have read till now is that the 64 bit CR runtime engine is ot shipped with the dll (crdb_dao.dll) which is available in 32 bit version.
Any suggestions... Any workarounds?
Appreciate your help :-)!
回答1:
It's all about bitness
With Access databases, you have to be careful about the bitness of your application:
There is not standard 64 bit driver for
.mdb
files (there is one by default in Windows for 32 bits though).To be able to access
.mdb
and.accdb
databases from a 64 bit application, you must have MSOffice 64 bit or Access 64 bit or the Access Database Engine drivers for 64 bit.
If you have MSOffice or Access 2007/2010/2013 32 bit installed on that machine, you won't be able to install the 64 bit driver, you can't mix and match 32 bit and 64 bit Office components.
To solve your issue
If you are using
.mdb
Access files, simply compile for 32 bits explicitly (not AnyCPU since it will try to launch your app as 64 bit in a 64 OS).If you are using
.accdb
Access files, match the bitness of Office/Access installed on the user machine, or, if Office isn't there, install the Access Database Engine driver.In any case, if your application is to be deployed in mixed 32 / 64 bit environments, you will need to compile explicitly for each and install the right version according to the bitness of the Access Database Engine or MSOffice installed on the user's machine.
Note: just to clarify, if MSOffice 2007/2010/2013 is already installed on the user's machine, there is no need to install the Access Database Engine.
回答2:
I had to install the CR Runtime engine for 32 bit as well. Now its working smooth :-)!
Thanks alot :)!
来源:https://stackoverflow.com/questions/13356765/winforms-crystal-report-failed-to-load-database-information-error