I am having issues with a report after switching the database from SQL Server 7 to SQL Server 2008. The report ran fine on our old server, it was Server 2000, and again was running SQL Server 7. We had to update the DSN driver to point to the new database. Now when someone runs our report, they receive this error:
I have tried to lower the master database compatibility level to SQL Server 2000(80), I thought maybe it had something to do with the user logins. The database that the report is pulling from is running on compatibility level to SQL Server 2000(80).
I have tried to google the report error, but everything that I have seen doesn't relate to my issue. I have tried to reinstall crystal reports, somethings this help fix any issues that I may have, however this time that didn't work.
I have tried to "fix" up the report as well. In crystal you can fix a report to make sure that it is point to the right database. I didn't fix any of the other reports, and they are working fine.
I have tried testing the query against SQL Management Studio, I am pulling the data that I wanted for the report with no errors. I know the query is working, so it can't be the statement.
I Have downloaded and installed the crystal report runtime 8.5, restarted the machine and reran the report. I still get the same results.
So far that I know of, the issue is only this report. We have other reports in our VB6 project that work just fine. Here is the code that runs the report:
Private Sub cmdPrintPo_Click()
Dim result As Variant
repSinglePo.ReportFileName = ReportDirectory + "\singlepo.rpt" repSinglePo.Destination = crptToPrinter repSinglePo.CopiesToPrinter = 1 repSinglePo.Connect = "DSN = clearspan;UID = " + glUserName + ";PWD = " + glPassword + _ ";DSQ = " & gsDatabaseName repSinglePo.SQLQuery = _ "SELECT" + _ " PO.PO_Num, PO.Supplier, PO.DateOrdered, PO.DateRequired, PO.Terms, PO.Freight, PO.FOB, " + _ " POItems.PO_Num, POItems.Quantity, POItems.Description, POItems.Item, POItems.Price, POItems.KeyNum " + _ " From" + _ " PO PO," + _ " POItems POItems" + _ " Where" + _ " PO.PO_Num = POItems.PO_Num and PO.PO_Num = " + lblPONum.caption 'Print Original Po and then a copy result = repSinglePo.PrintReport
repSinglePo.ReportFileName = ReportDirectory + "\po-copy.rpt" result = repSinglePo.PrintReport
If result = 0 Then MsgBox "PO has been printed"
Else Select Case CLng(result) Case 20520 DisplayErrorCode ("PrintingAlreadyStarted")
Case Else MsgBox "Error while printing PO. Error code: " + str(result) & vbCrLf & repSinglePo.LastErrorString End Select
End If End Sub
As you can tell in the picture above, the code bombs on at:
Case Else MsgBox "Error while printing PO. Error code: " + str(result) & vbCrLf & repSinglePo.LastErrorString End Select
I have tried to alter the select statement, thinking maybe there was a difference in the way the two versions perceived it. Nothing I did seemed to mater. Can someone point me in the right direction? Thanks for any help ahead of time.