I'm using CR8.5 and VB6 against an SQL Server 7 database.
Is it possible to use a view or sp from SQL Server as a datasource?
Here's an example I found here which is very close to what I want to do:
Dim adoConn as ADOdb.Connection
Dim adoRS as ADOdb.Recordset
Dim strSQL as String
Dim Report as CrystalReport1
strSQL = "Your SQL statement"
Set adoRS = New ADOdb.Recordset
With adoRS
.ActiveConnection = adoConn
.CursorLocation = adUseServer
.CursorType = adOpenForwardOnly
.Open strSQL
End With
Set Report = New CrystalReport1
Report.Database.SetDataSource adoRS
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
In this example, they're using the Crystal Viewer, where I would be using just the report object, Crystal32.ocx.
How would I set the value of strSQL equal to a view or stored procedure which is out on SQL Server?
Thanks
John
Is it possible to use a view or sp from SQL Server as a datasource?
Here's an example I found here which is very close to what I want to do:
Dim adoConn as ADOdb.Connection
Dim adoRS as ADOdb.Recordset
Dim strSQL as String
Dim Report as CrystalReport1
strSQL = "Your SQL statement"
Set adoRS = New ADOdb.Recordset
With adoRS
.ActiveConnection = adoConn
.CursorLocation = adUseServer
.CursorType = adOpenForwardOnly
.Open strSQL
End With
Set Report = New CrystalReport1
Report.Database.SetDataSource adoRS
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
In this example, they're using the Crystal Viewer, where I would be using just the report object, Crystal32.ocx.
How would I set the value of strSQL equal to a view or stored procedure which is out on SQL Server?
Thanks
John