win32com and ADO

Chris Curvey ccurvey at gmail.com
Wed May 11 14:59:41 EDT 2005


Thanks Peter.

I found the files that makepy generated (in
$PYTHON_HOME/Lib/site-packages/win32com/gen_py).  I've tried deleting
the individual files, and the entire directory, and I'm still getting
the error.  (Maybe something was changed in the registry?)

[Fun side note -- after deleting the files, I thought I would look in
them for the EOF, but they stubbornly refused to regenerate, giving an
error about "This file has already been processed".  The only way I
could regenerate the files was by deleting the win32com package via the
control panel and re-installing.]

In the generated files, I did find a reference to "EOF" (all caps) in
something called _prop_map_get_.  (I had tried a few different
variations on Eof, but none of them worked.)

At this point, the only way that I can get to the EOF property is to
force the dynamic dispatch by importing from com.win32.client.dynamic,
AND coding like this:

rs = Dispatch("ADODB.RecordSet")
rs.ActiveConnection = conn
rs.Open("select * from foo")
while not rs.EOF:
    doSomething()
    rs.MoveNext()

I hope someone can lend me a clue before I edit all of these query
instances...




More information about the Python-list mailing list