473,670 Members | 2,636 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem in generated files with makepy and Microsoft ADO

Hi,

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 2.4.1.245)

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 ?
File
"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)
File
"C:\Programme\P ython24\Lib\sit e-packages\win32c om\client\__ini t__.py", line
38, in __WrapDispatch
klass = gencache.GetCla ssForCLSID(resu ltCLSID)
File
"C:\Programme\P ython24\Lib\sit e-packages\win32c om\client\genca che.py", line
184, in GetClassForCLSI D
mod = GetModuleForCLS ID(clsid)
File
"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)
File
"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',
None,Index)
^
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',
None,Index)

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

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

when trying to generate the wrapper classes for Microsofts ADO Library
[bigsnip...]
Martin

Ok, I found some references to similar bugs at

http://www.python.org/sf/1163244,
http://www.python.org/sf/1089395 and
http://www.python.org/sf/1101726.
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

3
2686
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...
0
1810
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...
3
3001
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... :-)
0
1334
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 =...
2
2174
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).
2
2068
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. :-(
1
1506
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...
4
10392
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
1
1485
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:
0
8468
marktang
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...
0
8386
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8901
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8814
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 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...
1
8591
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,...
1
6213
isladogs
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...
0
4209
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4390
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1792
bsmnconsultancy
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.