I'm trying to run a crystal report from vb6 and I'm getting an error 20515 from the following code, any help will be appreciated.
Code:Private Sub MnuPurficationRoutinemasterList_Click() On Error GoTo HandleError Dim ReportName As String Dim lcReturnValue As String Dim lcNetworkPath As String Dim lcEntityName As String Dim lrsPurficationRoutineMasterReportData As ADOR.Recordset Dim loReports As TrxObject.clsReports Set loReports = New TrxObject.clsReports lcNetworkPath = "C:\SourceSafe\Tracs\TRACS7.0\client\" 'lcNetworkPath = GetNetworkPath Set lrsPurficationRoutineMasterReportData = loReports.GetPurficationRoutineMasterListRS Screen.MousePointer = vbHourglass If Dir(lcNetworkPath & "ReportsSQL\" & "PurficationRoutineMasterList.rpt") = "" Then MsgBox "Report Not Available.", vbCritical, "Report Error" Else CrystalReport1.ReportFileName = lcNetworkPath & "ReportsSQL\" & "PurficationRoutineMasterList.rpt" CrystalReport1.SetTablePrivateData 0, 3, lrsPurficationRoutineMasterReportData CrystalReport1.Destination = crptToWindow CrystalReport1.WindowTitle = "Tax Partners, L.L.C. - TRACS Reporting" CrystalReport1.WindowLeft = 0 CrystalReport1.WindowWidth = 800 CrystalReport1.WindowTop = 70 CrystalReport1.WindowHeight = 500 'If lrsTaxReturn.EOF = True Then ' lrsTaxReturn.AddNew ' lrsTaxReturn("Name") = goEntity.Name ' lrsTaxReturn.Update 'End If lcReturnValue = CrystalReport1.PrintReport ' Generate the report If Val(lcReturnValue) > 0 Then MsgBox "Error Number: " & lcReturnValue & Chr(13) & " Report Not Created." End If ' The reset method clear Crystal from memory. This ' allow the user to view one report, release the report and ' then view the next report quickly thereafter. ' Without the reset method the next report can not be viewed ' until 4 or 5 seconds later, because the previous crystal ' file was not being released from memory fast enough. CrystalReport1.Reset End If Screen.MousePointer = vbDefault Exit Sub HandleError: Dim liReturnValue As Integer liReturnValue = CentralErrorHandler(Err.Number, "MnuPurficationRoutinemasterList_Click", _ "frmMain", "TRACS.vbp") If liReturnValue = 0 Then Resume ElseIf liReturnValue = 1 Then Resume Next ElseIf liReturnValue = 2 Then Exit Sub End If End Sub




Reply With Quote