Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Crystal Reports 8.5 in VB 6
Message
From
20/02/2003 02:30:43
 
 
To
18/02/2003 12:03:07
General information
Forum:
Visual Basic
Category:
Other
Miscellaneous
Thread ID:
00753628
Message ID:
00755361
Views:
12
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!!!
Shit happens!!!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform