Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Crystal Reports 8.5 in VB 6
Message
De
20/02/2003 02:30:43
 
 
À
18/02/2003 12:03:07
Information générale
Forum:
Visual Basic
Catégorie:
Autre
Divers
Thread ID:
00753628
Message ID:
00755361
Vues:
25
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!!!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform