473,408 Members | 1,875 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

win32com and ADO

I'm having one of those weeks.

I have this pattern all over my code.

result = conn.execute("select * from foo")

while not result.EOF:
doSomething()
result.MoveNext()

So recently I got around to running makepy on all of the Microsoft
ActiveX Data Objects, and now every call to that pattern is returning:

'tuple' object has no attribute EOF

can anyone tell me how I'm supposed to be using EOF?

can anyone point me to the file that has the function lists?

can anyone tell me how to undo what I've done?

Jul 19 '05 #1
6 1968
Chris Curvey wrote:
I'm having one of those weeks.

I have this pattern all over my code.

result = conn.execute("select * from foo")

while not result.EOF:
doSomething()
result.MoveNext()

So recently I got around to running makepy on all of the Microsoft
ActiveX Data Objects, and now every call to that pattern is returning:

'tuple' object has no attribute EOF

can anyone tell me how I'm supposed to be using EOF?
There are case sensitivity differences with and without makepy. I think
after makepy you have to respect the case of all names, so check for Eof
or eof or something.
can anyone point me to the file that has the function lists?

can anyone tell me how to undo what I've done?


Remove the files created by makepy. I forget where they exist but
they're not hard to find (check the makepy source if nothing else).

-Peter
Jul 19 '05 #2
Chris Curvey wrote:
result = conn.execute("select * from foo")

while not result.EOF:
doSomething()
result.MoveNext()

'tuple' object has no attribute EOF


The recordset you are looking for is a element of the tuple. Out of my
head I would say it's element 1, so you have to write:

result = conn.execute("select * from foo")[1]

regards,
Achim
Jul 19 '05 #3
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...

Jul 19 '05 #4
Achim,

Bingo. The recordset is in item 0. And that appears to work even on
systems where makepy has not been run.

Thanks so much.

Jul 19 '05 #5
Chris Curvey wrote:
Achim,

Bingo. The recordset is in item 0. And that appears to work even on
systems where makepy has not been run.

Thanks so much.


So was this not really something that was working *before* you ran
makepy, or is there still an unsolved mystery there?
Jul 19 '05 #6
it was working fine before running makepy, once I ran makepy, I had to
add the array index to make it work.

Jul 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Justin Stockton | last post by:
I recently upgraded from ActivePython 2.2.2 to ActivePython 2.3.2 and I'm running into an issue importing the win32com.client module. Before installing the new version, I made sure to properly...
3
by: RJ | last post by:
Hi, I've been going over the Quick Start to Client side COM and Python and many other sources, but cannot find an example that will get my com/ActiveX .ocx USB device driver imported. The Excel...
0
by: Paul McGuire | last post by:
Software versions: Python - 2.3.3 win32all extensions - build 163 OS- Win2000 SP4 I am having trouble in accessing a customer's proprietary COM type library. After running makepy against the...
2
by: Sibylle Koczian | last post by:
Hello, I've installed Python 2.4 and the win32 extensions, using administrator rights, under Windows XP in "C:\Programme". As this is a directory without spaces I didn't expect any problems. But...
3
by: tyler.schlosser | last post by:
Hi there, I am trying to launch a program called AmiBroker using the command: AB = win32com.client.Dispatch("Broker.Application") However, I have a dual-core CPU and would like to launch two...
12
by: vithi | last post by:
Hi Any one tell me where I can get (or download) python modules win32com or win32com.client because I have to use "Dispatch" thanks
2
by: Ray | last post by:
Hi, I need to use cell's background color. when I record a macro from excel, it shows: Rows("7:7").Select With Selection.Interior .ColorIndex = 8 .Pattern = xlSolid
11
by: Bill Davy | last post by:
I am trying to edit Contacts in Outlook. This is so I can transfer numbers from my address book which is an Excel spreadsheet to my mobile phone. I came across the following snippet of code which...
4
by: sterling | last post by:
I'm curious as to why the difference between IDLE and pythonWin when using win32com. opening an excel file, i've attempted to grab the chart information out of the file. commands like co =...
2
by: RyanN | last post by:
Greetings, I'm trying to get DispatchWithEvents() to work with HyperAccess (terminal program) without much success. I've done a bunch of searching and found some examples using IE: This works...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.