By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,919 Members | 1,625 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,919 IT Pros & Developers. It's quick & easy.

crystal report conn

P: 21
hi , i using vb and backend access and external seagate crystal report
i create report having folling code

Public strReportPath As String
Public strRecordSelection As String
Dim crystal As New CRAXDRT.Application
Dim Report As New CRAXDRT.Report

Private Sub Form_Load()
On Error Resume Next
strRecordSelection = ""
strReportPath = App.Path & "\" & "Report1.rpt"

Set crystal = New CRAXDRT.Application
Set Report = Nothing
Set Report = crystal.OpenReport(strReportPath)

Set cn = New ADODB.Connection
cn.Open "DSN=sd"

strRecordSelection = ""
strReportPath = App.Path & "\" & "Report1.rpt"

Report.Database.LogOnServer "pdsodbc.dll", stud.mdb, sd 'sd =dsn

If strRecordSelection <> "" Then
Report.RecordSelectionFormula = strRecordSelection

End If
Report.DiscardSavedData 'CLEARS REPORT SO WE WORK FROM RECORDSET
Cry.ReportSource = Report 'LINK VIEWER TO REPORT
Cry.ViewReport
Cry.Zoom 1
Set crystal = Nothing

End Sub


but it gives error

server has not yet open
please what is problem in code
Sep 17 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.