Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
865 views
in Technique[技术] by (71.8m points)

.net - Winforms Crystal Report - "Failed to load database information" error

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. Error screen shot

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 :-)!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...