[python-win32] driving MS Access from python

Tim Roberts timr at probo.com
Tue Mar 14 02:26:01 CET 2006


Phill Atwood wrote:

>
>>     while not rs.EOF:
>>         print rs.Fields("FieldName1")
>>         rs.MoveNext()  
>
>
> This isn't working for me either.  Same error about
>
> error: (-2147352567, 'Exception occurred.', (0, 'ADODB.Recordset',
> 'Operation is not allowed when the object is closed.',
> 'C:\\WINDOWS\\HELP\\ADO270.CHM', 1240653, -2146824584), None)
> >>>
>
> the object being closed.  I'm not sure why it thinks that.  If I print
> rs it describes an instance etc.  and my result value from (rs,
> result) is 35 which is exactly the number of records updated by the
> query.  Could it have something to do with the fact that the query
> updates another table?  Do I need to look at that table?  Is that why
> rs is empty or closed.  Bizarre.


Well, yes, of course.  Action queries (UPDATE, DELETE, INSERT) don't
return a recordset.  Only SELECT queries do.  If all you're trying to do
is an UPDATE, then just do the Execute() and you're done.

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the Python-win32 mailing list