cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Report - Export to PDF - Error "Database Logon Failed"

0 Kudos

Hello All...

We developed a web service to export a crystal report to PDFand hosted in IIS (7.5) and calling this web service from classic asp page.

In developer machine which is running on Windows 7 with IIS (7.5) , the code works fine but when deployed to production server which is running on Windows Server 2012 R2 Standard with IIS(8.5) causes export to fail with error message - "Database Logon Failed".

Referred below similar links and tried suggested solutions but could not find a solution.

Can anyone from SAP help us with a solution, please.

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Does all classic ASP components exist on the new server?

https://docs.microsoft.com/en-us/iis/application-frameworks/running-classic-asp-applications-on-iis-...

Lots of reason why you get that error, need details for your reports data source, ODBC, OLE DB, Native or PC based?

If you refresh the report it should prompt you for parameters and/or database log on or file based data source.

0 Kudos

Does it work from the Viewer?

0 Kudos

Thanks for your response.

  • Ans 1: Yes.
  • Ans 2 : ODBC as report data source

In addition, the mentioned error thrown in below line of code in Web Service.

cryRpt.ExportToDisk(ExportFormatType.PortableDocFormat, @"" + file);

Thanks.

0 Kudos

Thanks for your intention of helping.

  • Ans1 : Yes. Moreover, all other existing classic asp related functionalities are working fine.
  • Ans2 : .It's ODBC datasource for report.

In addition, there is no connection to classic asp for this reported error since it's thrown at web service in below mentioned line of code:

...............................

................................

cryRpt.ExportToDisk(ExportFormatType.PortableDocFormat, @"" + file);

Thanks.

0 Kudos

@Don, thanks for your help.

Good news but updating you late that i found a solution for it.

Solution is "Changing the Driver in DSN in ODBC from SQL Server Native Client 11.0 to ODBC Driver 13 for SQL Server" and updated the report with this DSN solved the problem.

Thanks once again.

- AMP AMP

Answers (2)

Answers (2)

0 Kudos

FYI - ODBC 13 is not supported any more nor is Windows 7....

Good luck

DellSC
Active Contributor
0 Kudos

Are you explicitly setting the database credentials in your code? If you have the connection set up to use "Integrated Security" (Single Sign-On), then the web service needs to be run using the credentials of an account that has read access to the database.

-Dell

0 Kudos

Thanks for your response.

No configuration of database credentials in the code.

In addition, the mentioned error thrown in below line of code in Web Service.

cryRpt.ExportToDisk(ExportFormatType.PortableDocFormat, @"" + file);

Thanks.

0 Kudos

Thanks for your intention of helping.

No configuration of database credentials in the code.

In addition, reported error thrown at the line in below Web Service code.

...............................

................................

cryRpt.ExportToDisk(ExportFormatType.PortableDocFormat, @"" + file);

Thanks.

DellSC
Active Contributor
0 Kudos

You have to specifically set the database credentials in your code in order for this to work. Crystal only stores the user ID that you used when designing the report - it does NOT store the password with the report. The ODBC connection also does not store the password. You need to make sure that the ODBC connection on the server is NOT set up to use integrated authentication (SSO) and you'll need to provide specific credentials for the database.

If you look at the "Related Documents" section of the Crystal for VS Wiki, you'll see links to some sample programs and a "Getting Started" guide. The samples will show you how to log in to the database for your report.

-Dell

0 Kudos

Thanks once again for your response.

I will definitely try the suggested - "specifically set the database credentials in the code".

But one question - Why it was not the case when running in development environment (as detailed in the original post)? I mean, without this code, the report converted to pdf and saved in designated location.

Thanks.

DellSC
Active Contributor
0 Kudos

I suspect that the developer had the ODBC connection configured for SSO, so it automatically worked for that person.

-Dell

0 Kudos

@Dell, thanks for your continuous attention to help

Good news but updating you late that i found a solution for it.

Solution is "Changing the Driver in DSN in ODBC from SQL Server Native Client 11.0 to ODBC Driver 13 for SQL Server" and updated the report with this DSN solved the problem.

Thanks once again.

- AMP AMP