1 Attachment(s)
Proper commands for updating recordset created using SQL command from Data Environmen
I am unable to open the recordset created using SQL command from Data Environment Designer in VB6. I can see the table that gets created within Access but I cannot use the command MoveFirst to read the recordset sequentially to update the records selectively. Move First command generates the Run-time error ‘3704’: Operation is not allowed when the object is closed. Here is the outline of my code
vb Code:
Private Sub cmdProcess_Click()
Dim de1 As denCovcalc
Dim rst2 As Recordset
Set de1 = Nothing
Set rst3 = Nothing
Set de1 = denCovcalc
If de1.rscomCovactual.State = 1 Then
de1.rscomCovactual.Close
End If
de1.comCovactual
Set rst3 = de1.rscomCovactual
rst3.MoveFirst
If I try to insert the following command to open the recordset before rst3.MoveFirst command
vb Code:
If de1.rscomCovactual.State = 0 Then
de1.rscomCovactual.Open
End If
I get the error message that object is already open
Thanks!
Re: Proper commands for updating recordset created using SQL command from Data Environmen
You really should not use a data environment for what your trying to do. An ADO Recordset would work much better. If you don't know how to use ADO then there are tutorials on this site. ADO Tutorial
There are also lots and lots of posts on the subject.
Good Luck