crystal reports 8, subreports, visual basic 6
Posted on 2004-10-07
I have a Visual Basic 6 application calling a crystal report version 8 with a subreport. When attempting to invoke the crystal report it errors with "can not open SQL server - 20599." I have other crystal reports without subreports that work fine in the same application. The code is as follows:
Private Sub cmdSummary_Click()
Dim ODBC_String As String
On Error GoTo ErrorHandler
ODBC_String = "DSN=btireports.dsn;DSQ=" & pubstrDatabase & ";UID=bti;PWD=zoe"
crpReports.Connect = ODBC_String
If Me.cboDepartment <> "All" Then
crpReports.StoredProcParam(0) = Mid(Me.cboDepartment, 1, 7)
crpReports.StoredProcParam(0) = Me.cboDepartment
crpReports.ReportFileName = pubstrReportLocation & "ConsolidatedDeptDivLevelQuarterly.rpt"
crpReports.Action = 1
MsgBox "Printing Summary Report: " & Err.Description & " Error # " & Err.Number
Any help on why subreports do not work correctly in this context would be greatly appreciated.