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

Error Msg: Server has not yet been opened.

Status
Not open for further replies.

wendas

MIS
Apr 20, 2001
92
US
Running VB 6.0, Crystal Report 8.5.

I create my Crystal Rpts inside VB using the Designer, so they may be packaged and deployed within VB. These reports were running just fine until my boss put a password on the Sequel Server 'sa' account. Now the Crystal reports give me the "Server has not yet been opened" error when VB runs the CRViewer form.

Where do I go to put the password in, so Crystal remembers it? In Design mode (within VB), I opposite click within the Crystal report and pick Database, then Verify Database... it prompts for the password. I put it in and then try running the report. The error message displays with the empty CRViewer (no report in viewer).

I also tried removing the database from the report and adding it back in. The report looses all the fields bound to the database. Is there somewhere else I can look?

Any suggestions would be greatly appreciated.

TIA!,
Ann

 
Try this code: it will log into the server and log in any subreports you might have.

Billy

Private Sub Connect()

' Pass the connection for the main report.
Report.Database.Tables(1).SetLogOnInfo "dsn", "database", "user", "Pass"
' Pass the connection for the subreport. Locate subreports in the report.
For X = 1 To Report.Sections.Count
For Y = 1 To Report.Sections(X).ReportObjects.Count
If Report.Sections(X).ReportObjects(Y).Kind = crSubreportObject Then
Set SubObject = Report.Sections(X).ReportObjects(Y)
Set Subreport = Report.OpenSubreport(SubObject.SubreportName)
Subreport.Database.Tables(1).SetLogOnInfo "dsn", "database", "user", "Pass"
End If
Next Y
Next X

End Sub Billy Ballard

For in the past, Lies the future.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top