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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CR in VB6 "Server has not yet been opened"

Status
Not open for further replies.

harwooddale

Programmer
Feb 7, 2003
40
GB
Hi,
I have a crystal report version 8.5 which works fine on my pc. I have inserted it into VB6, following instructions from the Crystal Reports Developers Guide(8.5).
I get the error "Server has not yet been opened".
I have read a few posts from this forum and realised that you have to let VB connect to the database, even though
the report has all the connection info.
I am trying to connect to a Oracle 8i database.
I have the following code on the form which displays the report:

Option Explicit
Dim Report As New CrystalReport1

Private Sub Form_Load()
Screen.MousePointer = vbHourglass
Report.Database.Tables(1).SetLogOnInfo "SERVER", "DATABASE", "USER", "PASSWORD"
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
Screen.MousePointer = vbDefault

End Sub

Private Sub Form_Resize()
CRViewer1.Top = 0
CRViewer1.Left = 0
CRViewer1.Height = ScaleHeight
CRViewer1.Width = ScaleWidth

End Sub

Does anyone have any ideas?
Thanks

James
 
Is the connection using an ODBC driver or a native oracle connection? The code sample you've given above looks correct for a native connection...

Also, do you only have one table in the report?
 
Hi,
I am using one oracle view to generate the report.
There are no subreports and I am using ODBC..
 
The only thing I can think to suggest is that you make sure the "SERVER" portion of SetLogOnInfo is the name of the ODBC connection, not necessarily the server.

-dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top