Hi!
Please Help! I'm using the RDC component on VB6, when I launch my report the first time it runs ok, when I call it a second time I get this error -2147417848.
Here is my simplyfied code:
Option Explicit
Dim pedidos As New CrystalReport1
Dim lConnCtrlPed As ADODB.Connection
...
Private Sub Form_Load()
Dim fCmdPedidos As ADODB.Command
Dim fRstPedidos As ADODB.Recordset
Dim ConnectionInfo As CRAXDRT.ConnectionProperties
Set fCmdPedidos = New ADODB.Command
Set fRstPedidos = New ADODB.Recordset
Set fCmdPedidos.ActiveConnection = fConn
Set ConnectionInfo = pedidos.Database.Tables(1).ConnectionProperties
'Set the OLE DB Provider
ConnectionInfo.Item("Provider" = "SQLOLEDB"
'Set the physical server name
ConnectionInfo.Item("Data Source" = "DIAGW2K2"
'Set the database name
ConnectionInfo.Item("Initial Catalog" = "MSPRUEBA"
'Set the integrated security
ConnectionInfo.Item("Integrated Security" = True
'Set the user name
ConnectionInfo.Item("User ID" = "sa"
'Set the password
ConnectionInfo.Item("Password" = "pass"
'Set the fully qualified table name if different from the original data source
pedidos.Database.Tables(1).Location = "MSPRUEBA.dbo.X_CTRLPED_REPORTE"
... Open recordset
pedidos.DiscardSavedData
pedidos.Database.SetDataSource fRstPedidos
CRViewer91.ReportSource = pedidos
CRViewer91.ViewReport
Do While CRViewer91.IsBusy
DoEvents
Loop
... close recordset
Set fRstPedidos = Nothing
Set ConnectionInfo = Nothing
end sub
I get the error when I run again the report and try to execute this line:
'Set the OLE DB Provider
ConnectionInfo.Item("Provider" = "SQLOLEDB"
Any help or ideas would be very appreciated.
Magda
________________
Magda Banuet
Please Help! I'm using the RDC component on VB6, when I launch my report the first time it runs ok, when I call it a second time I get this error -2147417848.
Here is my simplyfied code:
Option Explicit
Dim pedidos As New CrystalReport1
Dim lConnCtrlPed As ADODB.Connection
...
Private Sub Form_Load()
Dim fCmdPedidos As ADODB.Command
Dim fRstPedidos As ADODB.Recordset
Dim ConnectionInfo As CRAXDRT.ConnectionProperties
Set fCmdPedidos = New ADODB.Command
Set fRstPedidos = New ADODB.Recordset
Set fCmdPedidos.ActiveConnection = fConn
Set ConnectionInfo = pedidos.Database.Tables(1).ConnectionProperties
'Set the OLE DB Provider
ConnectionInfo.Item("Provider" = "SQLOLEDB"
'Set the physical server name
ConnectionInfo.Item("Data Source" = "DIAGW2K2"
'Set the database name
ConnectionInfo.Item("Initial Catalog" = "MSPRUEBA"
'Set the integrated security
ConnectionInfo.Item("Integrated Security" = True
'Set the user name
ConnectionInfo.Item("User ID" = "sa"
'Set the password
ConnectionInfo.Item("Password" = "pass"
'Set the fully qualified table name if different from the original data source
pedidos.Database.Tables(1).Location = "MSPRUEBA.dbo.X_CTRLPED_REPORTE"
... Open recordset
pedidos.DiscardSavedData
pedidos.Database.SetDataSource fRstPedidos
CRViewer91.ReportSource = pedidos
CRViewer91.ViewReport
Do While CRViewer91.IsBusy
DoEvents
Loop
... close recordset
Set fRstPedidos = Nothing
Set ConnectionInfo = Nothing
end sub
I get the error when I run again the report and try to execute this line:
'Set the OLE DB Provider
ConnectionInfo.Item("Provider" = "SQLOLEDB"
Any help or ideas would be very appreciated.
Magda
________________
Magda Banuet