473,739 Members | 2,378 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem in generated files with makepy and Microsoft ADO


when trying to generate the wrapper classes for Microsofts ADO Library
(Version 2.8) with makepy, I run into the following problem. Here's what I
do (I use ActiveState Python

1.) Running makepy, selecting "Microsoft ActiveX Data Object 2.8"

2.) Starting PythonWin IDE

3.) When I type the following

import win32com.client .Dispatch
rs = win32com.client .Dispatch("ADOD B.Recordset")

I get this error

Traceback (most recent call last):
File "<interacti ve input>", line 1, in ?
"C:\Programme\P ython24\Lib\sit e-packages\win32c om\client\__ini t__.py", line
96, in Dispatch
return __WrapDispatch( dispatch, userName, resultCLSID, typeinfo,
UnicodeToString , clsctx)
"C:\Programme\P ython24\Lib\sit e-packages\win32c om\client\__ini t__.py", line
38, in __WrapDispatch
klass = gencache.GetCla ssForCLSID(resu ltCLSID)
"C:\Programme\P ython24\Lib\sit e-packages\win32c om\client\genca che.py", line
184, in GetClassForCLSI D
mod = GetModuleForCLS ID(clsid)
"C:\Programme\P ython24\Lib\sit e-packages\win32c om\client\genca che.py", line
245, in GetModuleForCLS ID
makepy.Generate ChildFromTypeLi bSpec(sub_mod, info)
File "C:\Programme\P ython24\lib\sit e-packages\win32c om\client\makep y.py",
line 307, in GenerateChildFr omTypeLibSpec
__import__("win 32com.gen_py." + dir_name + "." + child)
"C:\Programme\P ython24\lib\sit e-packages\win32c om\gen_py\2A751 96C-D9EB-4129-B803-931327F72D5Cx0x 2x8\_Recordset. py",
line 55
def Collect(self, Index=defaultNa medNotOptArg):
return self._ApplyType s_(-8, 2, (12, 0), ((12, 1),), 'Collect',
SyntaxError: invalid syntax

The Line containing the error reads as follows (in the generated
_Recordset.py file)

# The method Collect is actually a property, but must be used as a method
to correctly pass the arguments
def Collect(self, Index=defaultNa medNotOptArg):
return self._ApplyType s_(-8, 2, (12, 0), ((12, 1),), 'Collect',

Strangely, if I delete the comment line, everything runs fine! I've noticed
a similar problem with the Properties.py file when I was using the adodbapi
module: There I had to delete the generated line

from win32com.client import Dispatch

which also seems perfectly correct to me.

I cannot see any error in the code. As I would like to deploy my application
without having my customer to edit this line manually I would appreciate any
hint (compiler bug? Bug in the ADO type library?)!

Thanks in advance

Jul 19 '05 #1
1 3248
"Martin Stettner" <ma*********@co mplement.xxx.at > schrieb im Newsbeitrag
news:d8******** **@newsreader1. utanet.at...

when trying to generate the wrapper classes for Microsofts ADO Library

Ok, I found some references to similar bugs at

http://www.python.org/sf/1089395 and
It seems that Python 2.4.1 has problems with mbcs encodint. I'll try to
install the actual version of the pywin32 package (build 204) which seems to
implement a workaround.cuMa rtin
Jul 19 '05 #2

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

Similar topics

by: Gerson Kurz | last post by:
I have problems getting "COM makepy" working in ActivePython 2.3.2. This is what happens when I start "COM makepy" from the Pythonwin Menu: PythonWin 2.3.2 (#49, Nov 6 2003, 10:18:20) on win32. Portions Copyright 1994-2001 Mark Hammond (mhammond@skippinet.com.au) - see 'Help/About PythonWin' for further copyright information. >>> Failed to execute command: from win32com.client import makepy;makepy.main() Traceback (most recent call...
by: | last post by:
Hi, A month ago, I decided to move from Delphi to Python/wxPython for a good deal of my development work, and for the past few projects (which included a full re-write of our point-of-sale system) I've had no problems and been very pleased with the move. We're Sage (accounting software) developers and frequently link into Line 50 using a Sage supplied COM server. In Delphi, the code to create the client and a workspace (which is required...
by: Annie | last post by:
I am trying to call a COM object which expects a variant datatype to be passed in to the COM API object. However, I get "<COMObject <unknown>>" and the program fails. Below is my code in Python, and the same code in VB which is working fine... I guess this is a variant problem with python? How can I make this work? Would appreciate if someone can guide me as I am a python newbie... :-)
by: Jim Kerr | last post by:
Does makepy always respect versioning of interfaces? It appears as though makepy correctly handles versioning of objects you obtain directly, but not for objects you get via a function call. Here's a simple example to illustrate the point. I created the C++-based server for this example by pilfering some code in Andrew Troelsen's book on COM and ATL. car = Dispatch("ScriptibleCoCar.DualCoCar") person =...
by: nvhengr | last post by:
Has anyone seen this? When I run the COM Makepy utility and choose Microsoft Excel 9.0 Object Library (1.3), I get an application error message: PythonWin: Pythonwin.exe - Application Error The instruction at "0x77fcc87" referenced memory at "0x0307a705". The memory could not be "read". I do not get this error when I choose the Microsoft Office 9.0 Object Library (2.1).
by: Alexander Eisenhuth | last post by:
Hello together, My system: ActivePython 2.4.1 Windows XP I write a COM Server in VC++ 6.0 using ATL. So far so good. While I develop I got sometimes strange behaviour with makepy utility. Today again. :-(
by: Chris Curvey | last post by:
I'm trying to track down a performance issue in my Windows code, and hotshot is telling me that the most time and calls are spent in these methods ncalls tottime percall cumtime percall filename:lineno(function) 75975 63982.779 0.842 124464.419 1.638 c:\python24\lib\site-packages\win32com\client\dynamic.py:285(_make_method_) 71294 47871.424 0.671 50629.224 0.710...
by: Mike P | last post by:
I've got a slight problem when running an excel macro from python using the win32.com.client module, in that it says it can't load the DLL file (it doesn't say which one) and gives me the following error message Traceback (most recent call last): File "<string>", line 93, in ? File "<COMObject <unknown>>", line 14, in Run File "C:\Python24\lib\site-packages\win32com\client\dynamic.py", line
by: gundlach | last post by:
Hi! I've just written a Python speech-recognition module (http:// pyspeech.googlecode.com). It provides a clean and simple interface to the Microsoft Speech SDK using COM wrapper classes generated by PythonWin's MakePY utility. Once this is a mature module, I'd like to make it as useful as possible to the community, so I'd like to make installation as simple as possible. Currently, to get speech.py to work, you must first:
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.