Click to See Complete Forum and Search --> : error in crystal report


shruti23
July 3rd, 2008, 06:13 AM
Hello sirs,

i m using vb6 and cr9,ms access 2000.
my problem is while running reports it display error as
Query engine : Can not find dsn in connection string

i want run time reports.

pls help me
my code is as follws:-
Report.DiscardSavedData
Set rs = New ADODB.Recordset
rs.Open "Select * from ProductItem Where Scope=" & "'" & frmPurchaseReport.cmbScope.Text & "' And Date=" & frmPurchaseReport.dtpRDate.Value, cn, adOpenDynamic, adLockOptimistic

Set CRReport = CRApplication.OpenReport(App.Path & "\samReport1.rpt", 1)
CRReport.Database.SetDataSource rs
CRReport.DiscardSavedData
CRReport.ReadRecords
CRReport.Database.Verify

For i = 1 To CRReport.Database.Tables.Count
CRReport.Database.Tables(i).SetDataSource (App.Path & "\DB\WinStock.mdb")
CRReport.Database.Tables(i).Location = App.Path & "\DB\WinStock.mdb"
CRReport.Database.Tables(i).SetLogOnInfo "", App.Path & "\DB\WinStock.mdb", "Admin", "becool"
Next i
CRViewer91.ReportSource = Report
i have declared cn in module
thanks in advance
ple urget
regards
shruti