Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB6 Crystal 8.5 w/subreport gives Cannot Open SQL Server

Status
Not open for further replies.

SJG0526

Programmer
Jul 5, 2002
108
US
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:

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!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top