cancel
Showing results for 
Search instead for 
Did you mean: 

Database login failed after upgrade to VS 2008

Former Member
0 Kudos

I am having trouble with one of my reports after upgrading a project from VS 2005 to VS 2008. All reports work fine except for one. The one that doesn't work has a subreport and I am assuming that the subreport is the cause of the problem.

My configuration is - using Crystal Reports Professional XI (11.5.8.826)

The web server has Crystal reports server install, but I know very little about it. When I installed it, I had so much trouble configuring it, I don't know what it is that I finally got to work on the server. I think I ended up installing one of the runtimes a while back to get it working.

When I upgraded my project, I simply opened the project in VS 2008, set the target as .net 3.5, built it and everything works except for this one report.

Can someone please tell me what I need to install, or change on the server to make this work properly?

Is there a way that I can determine how my reports are being served up? As I said, I'm not very familiar with the CR server and I had a lot of trouble with it when I did the initial configuration.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

CR XI r2 is not supported with .NET 2008. Only versions of Crystal Reports supported in .NET 2008 are 10.5 which ships with .NET 2008 and CR 2008 (12.0).

I understand that all other reports work, and that is great. But, I'd say that is pure luck and I would not rely on the solution in it's present form to work when you deploy it. Your options:

Roll back to 10.5 (assemblies 10.0.3700) or upgrade to CR 2008, assemblies version 12.0.2200.

Ludek

Former Member
0 Kudos

Thanks for the reply. I got the upgrade complete, but I am still getting the database logon error. I am using Visual Studio 2008, C#, Crystal Reports 2008 (dll version 12.0.2), Sql Server 2000. All of my reports work fine except for this one. The difference in this one is that it has a subreport. The report and subreport are using stored procedures. I have tried using the sa account to login to them. They login to two different databases on the same database server.

Here is the code that I am using to login to the database.

public enum ReportDatabase{MGA, Brokers, Intranet, TimeClock };

public void SetDBLogonForTables(Tables tables, ReportDatabase database)

{

string _userid = string.Empty;

string _password = string.Empty;

switch (database)

{

case ReportDatabase.MGA:

_userid = "abc";

_password = "123";

break;

case ReportDatabase.Brokers:

_userid = "abc";

_password = "123";

break;

case ReportDatabase.Intranet:

_userid = "abc";

_password = "123";

break;

case ReportDatabase.TimeClock:

_userid = "abc";

_password = "123";

break;

}

ConnectionInfo _connection = new ConnectionInfo();

_connection.ServerName = "123.123.123.212";

_connection.DatabaseName = database.ToString();

_connection.UserID = _userid;

_connection.Password = _password;

foreach (Table table in tables)

{

TableLogOnInfo _logoninfo = table.LogOnInfo;

_logoninfo.ConnectionInfo = _connection;

table.ApplyLogOnInfo(_logoninfo);

}

}

former_member183750
Active Contributor
0 Kudos

There are a number of post in this forum on the issue of connecting to a database. Please search for those. Also, I'd recommend that you consult the developer help files:

https://boc.sdn.sap.com/node/14834

The following White Paper is also full of details re. CR and .NET:

http://www.businessobjects.com/global/pdf/dev_zone/VS2005_Walkthroughs.pdf

And finally, you may also want to check out these samples:

https://smpdl.sap-ag.de/~sapidp/012002523100006252822008E/net_win_smpl.exe

More samples are at these links:

https://smpdl.sap-ag.de/~sapidp/012002523100006252712008E/csharp_web_smpl.exe

https://smpdl.sap-ag.de/~sapidp/012002523100006252812008E/net_web_smpl.exe

https://boc.sdn.sap.com/dotnet/samples

http://vbcity.com/forums/faq.asp?fid=54&cat=Crystal%20Reports

Ludek

0 Kudos

Hi David,

From your code it looks like you are not setting the subreport log on info. Loop through the report objects and then open the subreport and set the logon info for it using your same loop as the main report.

Thank you

Don

Former Member
0 Kudos

Don,

See my previous code for looping through the tables. This is where I make the call to login to all the tables in the report and subreport.

reportHelper.SetDBLogonForTables(rdTimesheet.Database.Tables, c_Helper.ReportDatabase.TimeClock);

reportHelper.SetDBLogonForTables(rdTimesheet.Subreports[0].Database.Tables, c_Helper.ReportDatabase.Intranet);

Thanks,

David

Edited by: David Young on Oct 13, 2008 1:50 PM

Former Member
0 Kudos

Another couple of facts to note. This works fine on my development machine, it just doesn't work on the test or live servers. Also, it worked fine until I upgraded the project to Visual Studio 2008, and Crystal Reports 2008.

David

former_member183750
Active Contributor
0 Kudos

If it works on one box, not another, you're either looking at permission issues, or runtime issues. Two ways to approach this:

1) As a test, install the CR designer on the box that does not work. See if the report works in the designer, or what you have to do in the designer to make it work

2) Download the modules utility and compare the dlls on the working and non working boxes. Modules can be downloaded from here:

https://smpdl.sap-ag.de/~sapidp/012002523100006252802008E/modules.zip

The download includes instructions on how to use modules.

Ludek

Former Member
0 Kudos

Thanks to all of you for your feedback. I went through a lot of the suggestions and I finally have a fix.

Ludek - thanks for the modules tip. There were a couple of problem dll's still being loaded on the live machine. I got all of that straightened out and the problem was still occurring.

I loaded up crystal reports designer on the server and when I opened the report, it did not have the datasource (ole db for ms Sql server) defined in the report. I assigned the ole db, saved the report and it worked fine. If anyone knows, could you please tell me why this datasource would get lost going from development machine to live server.

Thanks,

David

Answers (0)