yelshetty
10-19-2000, 07:21 AM
I want to extract data from SQL server 6.5 database. for this I am using a recordset of Clientside,dynamic cursor,with adlockoptimistic. It is executing properly. but when I am trying to retrieve the records from the above recordset I am getting the following error :
Runtime error - 3704
The operation requested by the application is not allowed if the object is closed.
Pl. help
whelanp
10-19-2000, 08:43 AM
Post your connection and SQL string/stored procedure details.
yelshetty
10-20-2000, 12:38 AM
Hi,
Thanks for responding to my query. Herewith I am sending
the code. Pl. help me
Dim cn_conv As ADODB.Connection
Dim rs_conv_fetch As ADODB.Recordset
Dim cmd_conv As ADODB.Command
Dim sconnect As String
Dim prmcompany As ADODB.Parameter
Dim prmlocation As ADODB.Parameter
Set cn_conv = New ADODB.Connection
Set rs_conv_fetch = New ADODB.Recordset
sconnect = "PROVIDER=SQLOLEDB.1;PERSIST SECURITY=true;User ID=sa;Password=connection;Initial CATaLOG=POMDB;DATA SOURCE= ACLSRV"
With cn_conv
.ConnectionString = sconnect
.Open
.CursorLocation = adUseClient
End With
With rs_conv_fetch
.CursorLocation = adUseClient
.CursorType = adOpenDynamic
.LockType = adLockOptimistic
End With
Set cmd_conv = New ADODB.Command
cmd_conv.CommandText = "po_pendsup_acg"
cmd_conv.CommandType = adCmdStoredProc
cmd_conv.CommandTimeout = 1000
Set prmcompany = New ADODB.Parameter
prmcompany.Type = adVarChar
prmcompany.Size = 10
prmcompany.Direction = adParamInput
prmcompany.Value = "agacaclcap"
cmd_conv.Parameters.Append prmcompany
Set prmlocation = New ADODB.Parameter
prmlocation.Type = adVarChar
prmlocation.Size = 10
prmlocation.Direction = adParamInput
prmlocation.Value = "kan"
cmd_conv.Parameters.Append prmlocation
Set cmd_conv.ActiveConnection = cn_conv
Set rs_conv_fetch = cmd_conv.Execute
Dim norec As Long
Do While Not rs_conv_fetch.EOF ' This is the place where I 'am getting error
norec = norec + 1
rs_conv_fetch.MoveNext
Loop