Link to home
Start Free TrialLog in
Avatar of ButtonDownBobby
ButtonDownBobby

asked on

Crystal Reports prompts for DB logon

In visual studio Crystal Reports prompts for DB logon. The catch is it only does it when my platform target is in x64 mode but if i'm in x86 there is no prompt and the report shows up fine.

This is what I have installed:
User generated image
What can I do to have the x64 version not prompt for a logon.
Avatar of vasto
vasto
Flag of United States of America image

You probably have ODBC DSN created correctly on the 32 bits machine. On the 64 bits machine you need to create DSN using  this exe:

%windir%\SysWOW64\odbcad32.exe
If you are using a .mdb Microsoft Access database, you cannot compile for x64. You need to compile for x86.
Avatar of ButtonDownBobby
ButtonDownBobby

ASKER

We have an ODBC DSN created using %windir%\SysWOW64\odbcad32.exe. Also we are using SQL Server 2005.
Are you using the same user on both machines? Crystal will no ask you for credentials if it is able to connect to the database. With ODBC connection this means that you need to have a DSN set to work with a connection with integrated security. I can see 2 possible reasons to have DB Login dialog shown:
1. The user who is logged in on the 64 bits machine does not have permissions to connect to the database
2. The DSN on the 64 bits machine is not using integrated security
The user we use to log into the DB is the same for everyone.

Another thing is that when I publish the application in x64 the reports work on most of the machines. I think this has something to do with the crystal report runtime on my machine and the machines that have the same issue... I've upgraded my own to 13.0.8 with no change in results.
How do you pass the password for this user ? ODBC DSN does not include the password.
It's through ODBC DSN called "TDEV"
rptReport.DataSourceConnections[Inti].SetConnection("TDEV", "TDev", "user", "Password");

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of vasto
vasto
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I don't know why the 64 bit version of our code required a 32 bit ODBC DSN but, it did...