StormbringerX
Programmer
Hi All.
This may be a VB6 question, so pardon me if I've placed this in the wrong forum.
I have a VB6 application. Within that application I have created a Crystal Reports DSR. (By the way, I have saved it as a Crystal Report and run this report straight from Crystal Reports and it works fine). I also have a form in the VB with a crViewer. The connection is to a SQL2000 Database. My understanding of how this SHOULD work is this:
In the form that contains the crviewer, I have created an instance of the dsr. I Open the database. I then perform the Crystal Report Logonserver. Then I set the parameters. and finally I tell the viewer to load the report.
Here is the Code that seems to be failing
Option Explicit
Dim crBusiness as New clsPPBusiness 'my dsr
Private Sub Form_Load()
Dim strConnect as String
' The following Code is our Company's method of opening the
' Database. This is fine as it is working on several
' hundred classes that we're currently using.
Dim dbConnect as New clsDataBAseConnection
dim gcnProp as new ADODB.Connection
If dbConnect.LoginSucceeded then
strConnect=dbConnect.ConnectionString
gcnProp.Open strConnect
Endif
crBusiness.Database.LogonServer "DLL", "ServerName", "DataBase", "User", "PassWord"
crBusiness.ParameterFields(1).AddCurrentValue _
(frmBusiness.txtfrmBusinessBusinessNumber)
crBusiness.ParperOrientation = crPortrait
crBusinessViewer.ReportSource=crBusiness
crBusinessViewer.ViewReport
End Sub
The dll I'm using is p2ssql.dll
With this code I consistently get 1 of 2 results. Either it tells me "The server is not yet opened" or it prints but I get a blank sheet of paper.
Any help or any previous threads that someone can point me to would be sincerely appreciated.
Thanks
Dave
This may be a VB6 question, so pardon me if I've placed this in the wrong forum.
I have a VB6 application. Within that application I have created a Crystal Reports DSR. (By the way, I have saved it as a Crystal Report and run this report straight from Crystal Reports and it works fine). I also have a form in the VB with a crViewer. The connection is to a SQL2000 Database. My understanding of how this SHOULD work is this:
In the form that contains the crviewer, I have created an instance of the dsr. I Open the database. I then perform the Crystal Report Logonserver. Then I set the parameters. and finally I tell the viewer to load the report.
Here is the Code that seems to be failing
Option Explicit
Dim crBusiness as New clsPPBusiness 'my dsr
Private Sub Form_Load()
Dim strConnect as String
' The following Code is our Company's method of opening the
' Database. This is fine as it is working on several
' hundred classes that we're currently using.
Dim dbConnect as New clsDataBAseConnection
dim gcnProp as new ADODB.Connection
If dbConnect.LoginSucceeded then
strConnect=dbConnect.ConnectionString
gcnProp.Open strConnect
Endif
crBusiness.Database.LogonServer "DLL", "ServerName", "DataBase", "User", "PassWord"
crBusiness.ParameterFields(1).AddCurrentValue _
(frmBusiness.txtfrmBusinessBusinessNumber)
crBusiness.ParperOrientation = crPortrait
crBusinessViewer.ReportSource=crBusiness
crBusinessViewer.ViewReport
End Sub
The dll I'm using is p2ssql.dll
With this code I consistently get 1 of 2 results. Either it tells me "The server is not yet opened" or it prints but I get a blank sheet of paper.
Any help or any previous threads that someone can point me to would be sincerely appreciated.
Thanks
Dave