My VB6 code code calls a Crystal rpt that has a subreport. I'm getting the "Cannot open SQL server" error message when I run the VB6 app report. Here's what I'm doing:
Any ideas on what the problem may be?
Thanks!
Code:
CRPrt.DataFiles(0) = ""
CRPrt.DataFiles(1) = ""
CRPrt.DiscardSavedData = 1
CRPrt.Connect = GetConnectionStringRpt()
CRPrt.ReportFileName = AddFileName("Ext.rpt")
CRPrt.SubreportToChange = "Sub1"
CRPrt.Connect = GetConnectionStringRpt()
CRPrt.DataFiles(0) = ""
CRPrt.SubreportToChange = ""
CRPrt.SelectionFormula = "{Dtl.CUSKey} = '" & ClientID & "' and {Dtl.ItemNo} = '" & ItemID & "';"
CRPrt.Action = 1
Any ideas on what the problem may be?
Thanks!