Trying to add Crystal Report created in CR 8.5 to VB6 app and keep getting error that "Server has not yet been opened"
Saw a previous thread (April 2004)that mentioned that should set locations tried that and still getting error. I have other reports that I created in same VB6 app that display properly. Assuming it has something to do with the fact that report was created in Crystal and then added into VB6, but not sure. Any suggestions would be greatly appreciated.
Here is the code I am using this works, but when change to CrystalReport5 or any new report added I get above error.
Dim crxRep As New CrystalReport3
Dim oraRst As Recordset
Dim Sql As String
Dim strStatus As String
Private Sub Form_Load()
strStatus = "Active"
Set oraRst = New ADODB.Recordset
Sql = "Select Last_Name, First_Name, Lot_Name, Card.Card_Num " & _
"From Emp, HR_VIEW, Card, ParkingLot " & _
"Where Emp.Emp_ID = HR_VIEW.EMP_ID " & _
"and Emp.Card_Num = Card.Card_Num " & _
"and Card.Lot_ID=ParkingLot.Lot_ID " & _
"and Emp.Status = '" & strStatus & "' " & _
"Order By Lot_Name, Card_Num "
oraRst.ActiveConnection = G_OraConn
oraRst.LockType = adLockReadOnly
oraRst.Open Sql
crxRep.Database.SetDataSource oraRst
CRViewer1.ReportSource = crxRep
CRViewer1.ViewReport
End Sub
Private Sub Form_Resize()
SortedParking.WindowState = vbMaximized
With CRViewer1
.Top = 0
.Left = 0
.Width = ScaleWidth
.Height = ScaleHeight
.Zoom 100
End With
End Sub
Richard
Saw a previous thread (April 2004)that mentioned that should set locations tried that and still getting error. I have other reports that I created in same VB6 app that display properly. Assuming it has something to do with the fact that report was created in Crystal and then added into VB6, but not sure. Any suggestions would be greatly appreciated.
Here is the code I am using this works, but when change to CrystalReport5 or any new report added I get above error.
Dim crxRep As New CrystalReport3
Dim oraRst As Recordset
Dim Sql As String
Dim strStatus As String
Private Sub Form_Load()
strStatus = "Active"
Set oraRst = New ADODB.Recordset
Sql = "Select Last_Name, First_Name, Lot_Name, Card.Card_Num " & _
"From Emp, HR_VIEW, Card, ParkingLot " & _
"Where Emp.Emp_ID = HR_VIEW.EMP_ID " & _
"and Emp.Card_Num = Card.Card_Num " & _
"and Card.Lot_ID=ParkingLot.Lot_ID " & _
"and Emp.Status = '" & strStatus & "' " & _
"Order By Lot_Name, Card_Num "
oraRst.ActiveConnection = G_OraConn
oraRst.LockType = adLockReadOnly
oraRst.Open Sql
crxRep.Database.SetDataSource oraRst
CRViewer1.ReportSource = crxRep
CRViewer1.ViewReport
End Sub
Private Sub Form_Resize()
SortedParking.WindowState = vbMaximized
With CRViewer1
.Top = 0
.Left = 0
.Width = ScaleWidth
.Height = ScaleHeight
.Zoom 100
End With
End Sub
Richard