roh_8_it_3
Registered User.
- Local time
- Today, 13:47
- Joined
- Feb 15, 2005
- Messages
- 79
Hi,
I am calling a stored procedure..through vb.SP expects 2 parameters.
but i m getting error "operation cannot be performed when the object is closed".This is the code
Dim db1 As ADODB.Connection
Dim cmd1 As ADODB.Command
Dim prm1 As ADODB.Parameter
Dim prm2 As ADODB.Parameter
Dim rs1 As ADODB.Recordset
Set cmd1 = New Command
Set rs1 = New ADODB.Recordset
Set db1 = rtnConnection
Set cmd1.ActiveConnection = db1
cmd1.CommandType = adCmdStoredProc
cmd1.CommandText = "spname"
Set prm1 = cmd1.CreateParameter("param1", adChar, adParamInput, 3, BMF)
Set prm2 = cmd1.CreateParameter("param2", adInteger, adParamInput, 4, chnnlstobook)
cmd1.Parameters.Append prm1
cmd1.Parameters.Append prm2
Set rs1 = cmd1.Execute
If Not rs1.EOF Then
txtfield= rs1(1)
End If
On rs1.eof it gives me that message
Pls any help on this i am trying a lot to find the solution for this.
I am calling a stored procedure..through vb.SP expects 2 parameters.
but i m getting error "operation cannot be performed when the object is closed".This is the code
Dim db1 As ADODB.Connection
Dim cmd1 As ADODB.Command
Dim prm1 As ADODB.Parameter
Dim prm2 As ADODB.Parameter
Dim rs1 As ADODB.Recordset
Set cmd1 = New Command
Set rs1 = New ADODB.Recordset
Set db1 = rtnConnection
Set cmd1.ActiveConnection = db1
cmd1.CommandType = adCmdStoredProc
cmd1.CommandText = "spname"
Set prm1 = cmd1.CreateParameter("param1", adChar, adParamInput, 3, BMF)
Set prm2 = cmd1.CreateParameter("param2", adInteger, adParamInput, 4, chnnlstobook)
cmd1.Parameters.Append prm1
cmd1.Parameters.Append prm2
Set rs1 = cmd1.Execute
If Not rs1.EOF Then
txtfield= rs1(1)
End If
On rs1.eof it gives me that message
Pls any help on this i am trying a lot to find the solution for this.