Hi all,
I am connecting to a Pervasive DB from VB and am calling a stored procedure and trying to put the results into a recordset. This is VERY standard code and I use it all the time with MSSQL with no problems. But here, when I try to later reference the recordset, I keep getting the error :
"operation is not allowed when the object is closed"
Below is my VB code. My stored proc is a BASIC select statement:
Thanks for any help,
Sara
I am connecting to a Pervasive DB from VB and am calling a stored procedure and trying to put the results into a recordset. This is VERY standard code and I use it all the time with MSSQL with no problems. But here, when I try to later reference the recordset, I keep getting the error :
"operation is not allowed when the object is closed"
Below is my VB code. My stored proc is a BASIC select statement:
Code:
Dim cn as adodb.connection
Dim cmdBill As ADODB.Command
Dim rsBill As ADODB.Recordset
Set cn = New ADODB.Connection
cn.Open "Provider=PervasiveOLEDB;Data Source=MyPath"
'connection is fine
Set cmdBill = New ADODB.Command
With cmdBill
.ActiveConnection = cn
.CommandText = "spGetBills"
.CommandType = adCmdStoredProc
Set rsBill = .Execute
End With
Thanks for any help,
Sara