ADODB.Connection and ADODB.Recordset question 
Author Message
 ADODB.Connection and ADODB.Recordset question

Hello,
I am trying to add records without duplication to an Access 2000 db using
VBA. I first do a count query to see if a record with the new values is
already in the table. If not, I then do an insert query. I use a single
ADODB.Connection and 2 ADODB.Recoresets. When I try to close the 2nd
recordset, I get an error message saying 'Operation is not allowed when the
object is closed.' What's up?

--
Bill Swartz, PhD
Voss Scientific



Mon, 07 Nov 2005 04:35:01 GMT  
 ADODB.Connection and ADODB.Recordset question
Action queries (INSERT, UPDATE, DELETE) don't generate recordsets. That
might be the problem.

If the attempt inserts the record, just don't bother closing it. However, I
somehow suspect it won't work, so try using a Command object for the Insert.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele


Quote:
> Hello,
> I am trying to add records without duplication to an Access 2000 db using
> VBA. I first do a count query to see if a record with the new values is
> already in the table. If not, I then do an insert query. I use a single
> ADODB.Connection and 2 ADODB.Recoresets. When I try to close the 2nd
> recordset, I get an error message saying 'Operation is not allowed when
the
> object is closed.' What's up?

> --
> Bill Swartz, PhD
> Voss Scientific



Mon, 07 Nov 2005 07:54:40 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. ADODB.Connection.Execute VS ADODB.Recordset.Update

2. ADODB.connection & ADODB.Recordset

3. Creating adodb.record from Adodb.recordset

4. Question on Problem encountered w/ using ADODC DataControl.Recordset Property w/ ADODB.Recordset objects

5. Question on Problem encountered w/ using ADODC DataControl.Recordset Property w/ ADODB.Recordset objects

6. adodb connection to excel: recordset.fields(i).value=null for fields with numeric value

7. adodb connection to excel: recordset.fields(i).value=null for fields with numeric value

8. help please adodb connection and recordset

9. Problem with multiple RecordSets from a single ADODB.Connection

10. adodb connection to excel: recordset.fields(i).value=null for fields with numeric value

11. Question: Best practices with ADODB.Connection

12. do loop and adodb connection question

 

 
Powered by phpBB® Forum Software