Sunday, March 11, 2012

"Server has not yet been opened" - XP

I have the "Crystal Reports Viewer Control" in one of my VB 6.0 applications. The report was working great on the Windows 2000 OS, but when I moved the application to Windows XP it now gives the error "Server has not yet been opened". I have made sure that a system DSN has been created for the ODBC connection. I have connected to the DSN using the "Crystal SQL Connectivity Test Utility - SQLCON32". I even tried registering or re-registering many of the crystal dependencies. I have Crystal Reports 8.5 Professional Edition loaded and the report works fine if I open it with the Professional Edition, but not the viewer. I am baffled.

Code;
'* Start creating the crystal report for the crystal viewer.
Set crystal = New CRAXDRT.Application
Set sRPT = crystal.OpenReport(App.Path & "\DailyIS.rpt")
sRPT.DiscardSavedData
DoEvents
sRPT.Database.Tables(1).SetLogOnInfo "oracle", gDSN, gUserID, gPassWord
sRPT.Database.SetDataSource RS
crViewer.ReportSource = sRPT

crViewer.ViewReport '* (Where the error pops up)


Any ideas what my Windows XP issue might be?'* Start creating the crystal report for the crystal viewer.
Set crystal = New CRAXDRT.Application
Set sRPT = crystal.OpenReport(App.Path & "\DailyIS.rpt")
sRPT.DiscardSavedData
DoEvents

sRPT.Database.SetDataSource RS
crViewer.ReportSource = sRPT
crViewer.ViewReport '* (Where the error pops up)


if you are set ADODB.recordset in CR you don't need

sRPT.Database.Tables(1).SetLogOnInfo "oracle", gDSN, gUserID, gPassWord|||Thank you hensa22 for that information. I commented out that line of code and ran the report in Windows 2000 and received the message "Server has not yet been opened.", but the report displays with that line of code left in. In Windows XP I receive the message "Server has not yet been opened." with or without the code.

No comments:

Post a Comment