I can't Solve crystal report runtime error 20599 Cannot Open SQL Server
I am using VB6.0 and
crystal reports 8.5
and the code which i have written is as below
**********************************************************
GenerateDSN
With MAIN.CR
.Reset: MAIN.InitCrys
.ReportFileName = App.Path & "\Reports\rptVanInv.rpt"
.Connect = "DSN=" & App.Path & "\rptCN.dsn;PWD=philiprj"
.SelectionFormula = "{qry_WeeklyInv.VanInvFK} = " & nsdLoading.BoundText
.WindowTitle = "Van Inventory Report"
.ParameterFields(0) = "prBussAddr;" & CurrBiz.BUSINESS_ADDRESS & ";True"
.ParameterFields(1) = "prmBussContact;" & CurrBiz.BUSINESS_CONTACT_INFO & ";True"
.ParameterFields(2) = "prmTitle;VAN INVENTORY REPORT;True"
.ParameterFields(3) = "prmVanName;" & nsdLoading.getSelValueAt(3) & ";True"
.ParameterFields(4) = "prmDate;" & nsdLoading.getSelValueAt(2) & ";True"
.PageZoom 100
.Action = 1
End With
RemoveDSN
End If
*********************************************************
th error is
run-time error 20599 Cannot open SQl Server
Thanks
Re: I can't Solve crystal report runtime error 20599 Cannot Open SQL Server
PLZ any one have a solution
Re: I can't Solve crystal report runtime error 20599 Cannot Open SQL Server
Is your connection string correct?
ie .Connect = "DSN=" & App.Path & "\rptCN.dsn;PWD=philiprj"
Does the report work when you test it in Crystal Reports?
Re: I can't Solve crystal report runtime error 20599 Cannot Open SQL Server
Quote:
Originally Posted by SunshineBH
Is your connection string correct?
ie .Connect = "DSN=" & App.Path & "\rptCN.dsn;PWD=philiprj"
Does the report work when you test it in Crystal Reports?
yes its work
Re: I can't Solve crystal report runtime error 20599 Cannot Open SQL Server
What are the contents of the DSN file.
Comment out the line RemoveDSN and rerun the program. Does that make a difference?