Close causes 3219 error 
Author Message
 Close causes 3219 error

I have a piece of code which reads:

With adoInvoiceHeaderRS
    If .State = adStateOpen Then
        .Close
    End If
End With

With adoInvoiceLineRS
    If .State = adStateOpen Then
        .Close
    End If
End With

When it reaches the .Close for the first recordset, I receive the error
3219: Operation is not allowed in this context.

What's bizarre is that the second recordset's .Close works fine! I even
tried switching the order of execution, and it's always the
adoInvoiceHeaderRS close which blows.

Any ideas?

Thanks,

Greg Carter



Sat, 27 Apr 2002 03:00:00 GMT  
 Close causes 3219 error
Are you in an event handler for a recordset object when this occurs?.....
Quote:

>I have a piece of code which reads:

>With adoInvoiceHeaderRS
>    If .State = adStateOpen Then
>        .Close
>    End If
>End With

>With adoInvoiceLineRS
>    If .State = adStateOpen Then
>        .Close
>    End If
>End With

>When it reaches the .Close for the first recordset, I receive the error
>3219: Operation is not allowed in this context.

>What's bizarre is that the second recordset's .Close works fine! I even
>tried switching the order of execution, and it's always the
>adoInvoiceHeaderRS close which blows.

>Any ideas?

>Thanks,

>Greg Carter



Sun, 28 Apr 2002 03:00:00 GMT  
 Close causes 3219 error
Thanks, Brian, I figured it out: the .Close wouldn't process because VB saw
that there were changes made to the recordset, and didn't want to close it
until those changes were either applied or canceled. So I added a
.CancelUpdate before the .Close, and it works fine. Of course, as I clean up
the program I'll add a dialog box to warn the user that he's about to
discard changes made to the record.

That 3219 message is not very descriptive, is it? Nor is the ADO
documentation. Thank goodness for blind luck...


Quote:
> Are you in an event handler for a recordset object when this occurs?.....


> >I have a piece of code which reads:

> >With adoInvoiceHeaderRS
> >    If .State = adStateOpen Then
> >        .Close
> >    End If
> >End With

> >With adoInvoiceLineRS
> >    If .State = adStateOpen Then
> >        .Close
> >    End If
> >End With

> >When it reaches the .Close for the first recordset, I receive the error
> >3219: Operation is not allowed in this context.

> >What's bizarre is that the second recordset's .Close works fine! I even
> >tried switching the order of execution, and it's always the
> >adoInvoiceHeaderRS close which blows.

> >Any ideas?

> >Thanks,

> >Greg Carter



Sun, 28 Apr 2002 03:00:00 GMT  
 Close causes 3219 error
Quote:
>> That 3219 message is not very descriptive, is it? Nor is the ADO

documentation <<
Ah, the joys of Microsoft technology!  I couldn't agree with you more,
sometimes I wonder if they really want us using some of the things that they
put out given the state of the documentation.  I think that this new thing
with visual studio help being provided through MSDN is a BIG step backwards.
It has made it really difficult to find things in a narrow topic area (Like
VB specific things).  You have to wade through reams of irrelevant SHIT.
The quality of the documentation has also taken a couple of steps backward!

Quote:

>Thanks, Brian, I figured it out: the .Close wouldn't process because VB saw
>that there were changes made to the recordset, and didn't want to close it
>until those changes were either applied or canceled. So I added a
>.CancelUpdate before the .Close, and it works fine. Of course, as I clean
up
>the program I'll add a dialog box to warn the user that he's about to
>discard changes made to the record.

>That 3219 message is not very descriptive, is it? Nor is the ADO
>documentation. Thank goodness for blind luck...



>> Are you in an event handler for a recordset object when this occurs?.....


>> >I have a piece of code which reads:

>> >With adoInvoiceHeaderRS
>> >    If .State = adStateOpen Then
>> >        .Close
>> >    End If
>> >End With

>> >With adoInvoiceLineRS
>> >    If .State = adStateOpen Then
>> >        .Close
>> >    End If
>> >End With

>> >When it reaches the .Close for the first recordset, I receive the error
>> >3219: Operation is not allowed in this context.

>> >What's bizarre is that the second recordset's .Close works fine! I even
>> >tried switching the order of execution, and it's always the
>> >adoInvoiceHeaderRS close which blows.

>> >Any ideas?

>> >Thanks,

>> >Greg Carter



Mon, 29 Apr 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Close causes 3219 error

2. Close causes 3219 error

3. error 3219: invalid operation

4. Run-Time Error '3219'

5. error 3219

6. Access Querries revisited and Error 3219

7. Runtime Error 3219 on Append?

8. SQL Error #3219

9. ADO error 3219

10. Run-time errors 3704 and 3219

11. Run-time error 3078 and 3219 (Problem with dbSqlPassThrough and FindFirst)

12. Error 3219 Can't perform ......

 

 
Powered by phpBB® Forum Software