I faced exactly the same issue. Was using push method (Though I was passing data to the report instead of runtime DB pull method) to show crystal report but even then Crystal Report was not showing up in the Crystal Report Viewer and this nasty 'Database Logon Failed' error was coming. The report shows up fine in Visual Studio but is empty with this error in the viewer when running the IIS deployed web application.
All the while I thought my application which generates Crystal Report in Crystal Report Web viewer needed the PC Admin user credentials to work when deployed in IIS on our web server. (IIS -> My web application -> Advanced Settings - > Set Physical path credentials...but this is not needed and whenever there was change in user password I had to manually set the password again to make the Crystal report show up in the viewer in my web application - well this was a manual work around I followed until I got the solution !! Read further)
Figured out this Database Logon error was actually because I was just setting the entire dataset to the datasource for the Crystal Report's Main report and forgot to set datasource separately for the sub reports I had in my report. Crystal Report looks for it too :)
So those of you folks who have sub-reports in your crystal report, you should set the datasource separately to all the sub-reports too apart from the Main report. And voila that solved the issue for me !!! And I love crystal reports again :)
This is the wrong way to set data source if there are sub reports too in the crystal report -
Dim myReportDataset as New Dataset
Dim rptCrystalReport As New MyCrystalReport
//Fetch data from DB as datatables and set to the dataset
...
//Process your dataset and dataset tables here
....
//Setting Datasource to report
rptCrystalReport.SetDataSource(myReportDataset)
The correct method is as below :
Dim myReportDataset as New Dataset
Dim rptCrystalReport As New MyCrystalReport
//Fetch data from DB as datatables and set to the dataset
...
//Process your dataset and dataset tables here
....
//Setting Datasource to report
rptCrystalReport.SetDataSource(myReportDataset)
rptCrystalReport.Subreport.Item("sub_report1").SetDataSource(myReportDataset.Tables("Sub_Report1_Datatable"))
rptCrystalReport.Subreport.Item("sub_report2").SetDataSource(myReportDataset.Tables("Sub_Report2_Datatable"))