Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Crystal Reports 8.5 in VB 6
Message
From
20/02/2003 11:05:07
 
 
To
20/02/2003 02:30:43
General information
Forum:
Visual Basic
Category:
Other
Miscellaneous
Thread ID:
00753628
Message ID:
00755564
Views:
12
This message has been marked as a message which has helped to the initial question of the thread.
Crystal Decisions has a document that discusses this error message at http://support.crystaldecisions.com/communityCS/TechnicalPapers/cr_server_not_yet_been_opened.pdf.asp

One other thing I see here. Why are you using a DSN? If you supply a DSN to ADO, it will access the data through an ODBC driver, adding overhead that is not needed. You should supply an ADO connection string.



>Option Explicit
>Dim CRApp As CRAXDDRT.Application
>Dim Rpt As CRAXDDRT.Report
>Dim cn As Connection
>Dim rs As RecordSet
>
>Private Sub Form_Load()
> Set cn = New Connection
> cn.CursorLocation = adUseClient
> cn.Open "dsn=SQLServer","sa"
>
> Set rs = New Recordset
> rs.Open "Select * from Banks where Branch='Area 5'", cn, adOpenKeyset, adLockBatchOptimistic
>
> Set CRApp = New CRAXDDRT.Application
>
> Set Rpt = CRApp.OpenReport(App.Path & "\Report1.rpt")
> Rpt.DiscardSavedData
>
> Rpt.Database.SetDataSource rs
>
> crv.ReportSource = Rpt
> crv.ViewReport
>End Sub
>
>I made a sample form with the CRViewer object. When I run this simple code, I get a "SERVER HAS NOT YET BEEN OPENNED" error. I checked the state of the connection object... it is ok. I cheched the recordset state and contents... they're all ok. I cheched the SQL server and it is working fine. I've been trying to figure this out for two weeks now and I can't figure out what is wrong... HELP ME PLEASE!!!
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform