Runtime error: server has not yet been opened Crystal reports

20 pts.
Tags:
Crystal Reports
Crystal Reports error messages
Hello everyone, I'm a novice programmer trying to display Crystal Report 8.5 report (C:Try.rpt) through my VB6 program. It is to be mentioned that the database that I'm useing is Oracle 9i installed on the same computer and Global Database Name/SID is 'exim'. The report (C:Try.rpt) I'm trying to display is saved after unchecking the "Save Data With Report" option of Crystal Report 8.5. I'm using the following code -
 
Public cn As New ADODB.Connection
Public rs As New ADODB.Recordset
Public CnString As String
Public SQLSelect As String
Public crxApp As New CRAXDRT.Application
Public crxReport As CRAXDRT.Report
 
Private Sub Form_Load()
Call OpenDatabase
Call LoadReport
End Sub
 
Public Function LoadReport()
Set crxReport = New CRAXDRT.Report
Set crxApp = CreateObject("CrystalRuntime.Application")
Set crxReport = crxApp.OpenReport("C:Try.rpt", 1) crxReport.DiscardSavedData
crxReport.Database.SetDataSource rs
crvViewer.ReportSource = crxReport
crvViewer.ViewReport
rs.Close
cn.Close
End Function
 
Public Function OpenDatabase()
Set cn = New ADODB.Connection
CnString = "Provider=OraOLEDB.Oracle.1;Password=tiger;Persist Security Info=True;User ID=scott;Data Source=exim" cn.ConnectionString = CnString
cn.Open
cn.CursorLocation = adUseClient
SQLSelect = "SELECT * FROM EMP_VIEW"
rs.Open SQLSelect, cn, adOpenDynamic, adLockReadOnly
End Function
 
Private Sub Form_Resize()
crvViewer.Top = 0
crvViewer.Left = 0
crvViewer.Height = ScaleHeight
crvViewer.Width = ScaleWidth
End Sub
When I'm trying to run this program, I'm getting an error message - "Run-time error: server has not yet been opened"
Can anyone please check my codings and help me to rectify the problem. I'll be glad if someone can email me at rezakhandaker@yahoo.com with the solution to this problem. Thanks in advance. With best regards
Reza Khandaker 4/4,
Golden Tower, Golden Street, Ring Road,
Shyamoli, Dhaka - 1207 Bangladesh
Cell: 0088-01730-031453


Software/Hardware used:
VB6, Oracle 9i, Crystal Report 8.5, Windows XP

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • carlosdl
    What is the line of code where the error is occurring ?
    70,220 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following