From aclark at aclark.net Thu Aug 2 04:46:32 2012 From: aclark at aclark.net (Alex Clark) Date: Wed, 01 Aug 2012 22:46:32 -0400 Subject: [python-win32] [ANN] pythonpackages.com beta Message-ID: Hi Python Windows folks, I am reaching out to various Python-related programming communities in order to offer new help packaging your software. If you have ever struggled with packaging and releasing Python software (e.g. to PyPI), please check out this service: - http://pythonpackages.com The basic idea is to automate packaging by checking out code, testing, and uploading (e.g. to PyPI) all through the web, as explained in this introduction: - http://docs.pythonpackages.com/en/latest/introduction.html Also, I will be available to answer your Python packaging questions most days/nights in #pythonpackages on irc.freenode.net. Hope to meet/talk with all of you soon. Alex P.S. I've also just written a new Windows-specific blog entry: http://blog.aclark.net/2012/08/01/building-windows-installers-in-the-cloud/ -- Alex Clark ? http://pythonpackages.com/ONE_CLICK From iceblink at chello.nl Thu Aug 2 10:23:07 2012 From: iceblink at chello.nl (iceblink) Date: Thu, 02 Aug 2012 10:23:07 +0200 Subject: [python-win32] [ANN] pythonpackages.com beta In-Reply-To: References: Message-ID: <193ae953acb384808b8eccddd3fdeb0f@pro.dohd.org> With news of new hacks appearing almost daily in the news, I have to ask: How do you guarantee that nothing is changed to the software while it is being processed in the cloud? Best regards, Patrick Asselman On 2012-08-02 04:46, Alex Clark wrote: > Hi Python Windows folks, > > > I am reaching out to various Python-related programming communities > in > order to offer new help packaging your software. If you have ever > struggled with packaging and releasing Python software > (e.g. to PyPI), please check out this service: > > > - http://pythonpackages.com > > > The basic idea is to automate packaging by checking out code, > testing, > and uploading (e.g. to PyPI) all through the web, as explained in > this > introduction: > > > - http://docs.pythonpackages.com/en/latest/introduction.html > > > Also, I will be available to answer your Python packaging questions > most days/nights in #pythonpackages on irc.freenode.net. Hope to > meet/talk with all of you soon. > > > > Alex > > > > P.S. I've also just written a new Windows-specific blog entry: > > http://blog.aclark.net/2012/08/01/building-windows-installers-in-the-cloud/ From aclark at aclark.net Thu Aug 2 14:56:29 2012 From: aclark at aclark.net (Alex Clark) Date: Thu, 02 Aug 2012 08:56:29 -0400 Subject: [python-win32] [ANN] pythonpackages.com beta In-Reply-To: <193ae953acb384808b8eccddd3fdeb0f@pro.dohd.org> References: <193ae953acb384808b8eccddd3fdeb0f@pro.dohd.org> Message-ID: Hi Patrick, On 8/2/12 4:23 AM, iceblink wrote: > With news of new hacks appearing almost daily in the news, I have to ask: > How do you guarantee that nothing is changed to the software while it is > being processed in the cloud? Good question. In short: - http://docs.pythonpackages.com/en/latest/faq.html#why-are-you-executing-untrusted-code-in-setup-py But obviously there is always room for improvement. If you have any specific suggestions or features you'd like to see implemented, please open a ticket here: - https://bitbucket.org/pythonpackages/pythonpackages.com/issues/new Alex > > Best regards, > Patrick Asselman > > On 2012-08-02 04:46, Alex Clark wrote: >> Hi Python Windows folks, >> >> >> I am reaching out to various Python-related programming communities in >> order to offer new help packaging your software. If you have ever >> struggled with packaging and releasing Python software >> (e.g. to PyPI), please check out this service: >> >> >> - http://pythonpackages.com >> >> >> The basic idea is to automate packaging by checking out code, testing, >> and uploading (e.g. to PyPI) all through the web, as explained in this >> introduction: >> >> >> - http://docs.pythonpackages.com/en/latest/introduction.html >> >> >> Also, I will be available to answer your Python packaging questions >> most days/nights in #pythonpackages on irc.freenode.net. Hope to >> meet/talk with all of you soon. >> >> >> >> Alex >> >> >> >> P.S. I've also just written a new Windows-specific blog entry: >> >> http://blog.aclark.net/2012/08/01/building-windows-installers-in-the-cloud/ >> -- Alex Clark ? http://pythonpackages.com/ONE_CLICK From janechen_1979 at yahoo.com Thu Aug 2 20:00:28 2012 From: janechen_1979 at yahoo.com (Jane Chen) Date: Thu, 2 Aug 2012 11:00:28 -0700 (PDT) Subject: [python-win32] creating disk image In-Reply-To: References: Message-ID: <1343930428.81957.YahooMailNeo@web164001.mail.gq1.yahoo.com> Hi all, I would like to create disk image through?SHCreateStreamOnFileEx,IStream::Read, and?IStream::Write.?However, I cannot find these API in python-win32. I am wondering how to create disk image through python. Thank you, Jane -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Fri Aug 3 21:39:33 2012 From: timr at probo.com (Tim Roberts) Date: Fri, 3 Aug 2012 12:39:33 -0700 Subject: [python-win32] creating disk image In-Reply-To: <1343930428.81957.YahooMailNeo@web164001.mail.gq1.yahoo.com> References: <1343930428.81957.YahooMailNeo@web164001.mail.gq1.yahoo.com> Message-ID: <501C28F5.5030605@probo.com> Jane Chen wrote: > > I would like to create disk image > through SHCreateStreamOnFileEx,IStream::Read, > and IStream::Write. However, I cannot find these API in python-win32. > I am wondering how to create disk image through python. What are you actually trying to do? Unless you are working with COM structured storage (like an old Word document), these APIs provide no services that cannot also be done much more easily with normal Python I/O. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From timr at probo.com Fri Aug 3 21:47:23 2012 From: timr at probo.com (Tim Roberts) Date: Fri, 3 Aug 2012 12:47:23 -0700 Subject: [python-win32] creating disk image In-Reply-To: <501C28F5.5030605@probo.com> References: <1343930428.81957.YahooMailNeo@web164001.mail.gq1.yahoo.com> <501C28F5.5030605@probo.com> Message-ID: <501C2ACB.20904@probo.com> Tim Roberts wrote: > Jane Chen wrote: >> I would like to create disk image >> through SHCreateStreamOnFileEx,IStream::Read, >> and IStream::Write. However, I cannot find these API in python-win32. >> I am wondering how to create disk image through python. > What are you actually trying to do? I see now that you said you are trying to create a disk image. Do you mean a CD image, like an .iso file? That doesn't require these APIs. The example you borrowed those from was a scripting example, in a language where standard I/O is not available. You just need normal Python I/O. However, ISO files are complicated. If you do not already know how to create one, you should investigate one of the existing utilities, like mkisofs. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From rupole at hotmail.com Sun Aug 5 06:35:14 2012 From: rupole at hotmail.com (Roger Upole) Date: Sun, 5 Aug 2012 00:35:14 -0400 Subject: [python-win32] creating disk image References: <1343930428.81957.YahooMailNeo@web164001.mail.gq1.yahoo.com> Message-ID: There's a FileStream class in \win32com\server\util.py that creates an IStream connected to a file. If you still need SHCreateStreamOnFileEx, put in a feature request on Sourceforge, and I'll try to get that function added to win32com.shell. Roger From paul_hemans at laberg.com.au Sun Aug 5 15:13:39 2012 From: paul_hemans at laberg.com.au (Paul Hemans) Date: Sun, 5 Aug 2012 23:13:39 +1000 Subject: [python-win32] Python COM server throws 'module' object has no attribute 'VARIANT' Message-ID: Can someone tell me what is going wrong. The following works on one machine but not on another. Here is a COM server implemented in Python: from win32com.server.exception import COMException import pythoncom import sys import os from string import Template import logging import logging.config class Connector: _reg_clsctx_ = pythoncom.CLSCTX_LOCAL_SERVER _reg_clsid_ = "{0CE25AEB-1AFA-4DA7-97BD-F93CDBFB376C}" _reg_desc_ = "Python Test COM Server" _reg_progid_ = "Compy.Connect" _public_methods_ = ['Process', 'Status'] _public_attrs_ = [] _readonly_attrs_ = [] def Process(self, what): pass def Status(self): return Template(""" Current Directory: $dir Installed: $script PythonPATH: $pyPath """).substitute(dir = os.getcwd(), script = os.path.abspath(__file__), pyPath = sys.path) if __name__ == '__main__': import win32com.server.register win32com.server.register.UseCommandLine(Connector) It registers ok. When it is run it causes the following to occur on the production machine but NOT on the development box: >>> cc = CreateObject("Compy.Connect") >>> cc.Status() Traceback (most recent call last): File "", line 1, in File "C:\Python26\lib\site-packages\comtypes\client\dynamic.py", line 42, in _ _call__ return self._obj._comobj.Invoke(self._id, *args) File "C:\Python26\lib\site-packages\comtypes\automation.py", line 717, in Invo ke raise COMError(hresult, text, details) _ctypes.COMError: (-2147352567, 'Exception occurred.', (u"Unexpected Python Erro r: AttributeError: 'module' object has no attribute 'VARIANT'\n", u'Python COM S erver Internal Error', None, 0L, -2147467259)) >>> I have installed comtypes 0.6.2. Running Python 2.6.6 -------------- next part -------------- An HTML attachment was scrubbed... URL: From skippy.hammond at gmail.com Mon Aug 6 03:41:55 2012 From: skippy.hammond at gmail.com (Mark Hammond) Date: Mon, 06 Aug 2012 11:41:55 +1000 Subject: [python-win32] Python COM server throws 'module' object has no attribute 'VARIANT' In-Reply-To: References: Message-ID: <501F20E3.7030501@gmail.com> I don't quite understand this code. The server is using win32com (ie, not comtypes), but the client code seems to be using comtypes rather than win32com (but it's hard to tell as the client code is missing the imports etc). But at face value it appears one of the machines might have an older version of comtypes installed. Mark On 5/08/2012 11:13 PM, Paul Hemans wrote: > Can someone tell me what is going wrong. The following works on one > machine but not on another. > > Here is a COM server implemented in Python: > > |from win32com.server.exceptionimport COMException > > import pythoncom > > import sys > > import os > > from string import Template > > import logging > > import logging.config > > > class Connector: > > _reg_clsctx_= pythoncom.CLSCTX_LOCAL_SERVER > > _reg_clsid_= "{0CE25AEB-1AFA-4DA7-97BD-F93CDBFB376C}" > > _reg_desc_= "Python Test COM Server" > > _reg_progid_= "Compy.Connect" > > _public_methods_= ['Process', 'Status'] > > _public_attrs_= [] > > _readonly_attrs_= [] > > > def Process(self, what): > > pass > > > def Status(self): > > return Template(""" > > Current Directory: $dir > Installed: $script > PythonPATH: $pyPath > """).substitute(dir= os.getcwd(), > > script= os.path.abspath(__file__), > > pyPath= sys.path) > > > if __name__== '__main__': > > import win32com.server.register > > win32com.server.register.UseCommandLine(Connector) > > | > > It registers ok. When it is run it causes the following to occur on the > production machine but NOT on the development box: > > |>>> cc= CreateObject("Compy.Connect") > >>>> cc.Status() > > Traceback (most recent calllast): > > File "", line1, in > > File "C:\Python26\lib\site-packages\comtypes\client\dynamic.py", line42, in _ > > _call__ > return self._obj._comobj.Invoke(self._id, *args) > > File "C:\Python26\lib\site-packages\comtypes\automation.py", line717, in Invo > > ke > raise COMError(hresult, text, details) > > _ctypes.COMError: (-2147352567, 'Exception occurred.', (u"Unexpected Python Erro > > r: AttributeError: 'module' object has no attribute 'VARIANT'\n", u'Python COM S > > erver Internal Error', None, 0L, -2147467259)) > >>>> > > | > > I have installed comtypes 0.6.2. Running Python 2.6.6 > > > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > From paul_hemans at laberg.com.au Mon Aug 6 07:58:28 2012 From: paul_hemans at laberg.com.au (Paul Hemans) Date: Mon, 6 Aug 2012 15:58:28 +1000 Subject: [python-win32] Python COM server throws 'module' object has no attribute 'VARIANT' In-Reply-To: <501F20E3.7030501@gmail.com> References: <501F20E3.7030501@gmail.com> Message-ID: Hi Mark, Thanks for the response. Here is what I am using to instantiate the server through python >>> from comtypes.client import CreateObject >>> cc= CreateObject("Compy.Connect") >>> cc.Status() The com server also fails when being accessed from vbscript. I have verified that both machines have comtypes 0.6.2 loaded. Win32com works on the same machine that comtypes works >>> import win32com.client >>> wcc = win32com.client.Dispatch("Compy.Connect") >>> wcc.Status() When I run this on the machine that fails with comtypes I get: Traceback (most recent call last): File "", line 1, in File "", line 2, in Status pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, u'Python COM Server Internal Error', u"Unexpected Python Error: AttributeError: 'module' object has no attribute 'VARIANT'\n", None, 0, -2147467259), None) Do you have any suggestions as to what I can test? Thanks, Paul On Mon, Aug 6, 2012 at 11:41 AM, Mark Hammond wrote: > I don't quite understand this code. The server is using win32com (ie, not > comtypes), but the client code seems to be using comtypes rather than > win32com (but it's hard to tell as the client code is missing the imports > etc). But at face value it appears one of the machines might have an older > version of comtypes installed. > > Mark > > > On 5/08/2012 11:13 PM, Paul Hemans wrote: > >> Can someone tell me what is going wrong. The following works on one >> machine but not on another. >> >> Here is a COM server implemented in Python: >> >> |from win32com.server.**exceptionimport COMException >> >> >> import pythoncom >> >> import sys >> >> import os >> >> from string import Template >> >> import logging >> >> import logging.config >> >> >> class Connector: >> >> _reg_clsctx_= pythoncom.CLSCTX_LOCAL_SERVER >> >> _reg_clsid_= "{0CE25AEB-1AFA-4DA7-97BD-**F93CDBFB376C}" >> >> _reg_desc_= "Python Test COM Server" >> >> _reg_progid_= "Compy.Connect" >> >> _public_methods_= ['Process', 'Status'] >> >> _public_attrs_= [] >> >> _readonly_attrs_= [] >> >> >> def Process(self, what): >> >> pass >> >> >> def Status(self): >> >> return Template(""" >> >> Current Directory: $dir >> Installed: $script >> PythonPATH: $pyPath >> """).substitute(dir= os.getcwd(), >> >> script= os.path.abspath(__file__), >> >> pyPath= sys.path) >> >> >> if __name__== '__main__': >> >> >> import win32com.server.register >> >> win32com.server.register.**UseCommandLine(Connector) >> >> | >> >> It registers ok. When it is run it causes the following to occur on the >> production machine but NOT on the development box: >> >> |>>> cc= CreateObject("Compy.Connect") >> >> >> cc.Status() >>>>> >>>> >> Traceback (most recent calllast): >> >> File "", line1, in >> >> File "C:\Python26\lib\site-**packages\comtypes\client\**dynamic.py", >> line42, in _ >> >> _call__ >> return self._obj._comobj.Invoke(self.**_id, *args) >> >> File "C:\Python26\lib\site-**packages\comtypes\automation.**py", >> line717, in Invo >> >> >> ke >> raise COMError(hresult, text, details) >> >> _ctypes.COMError: (-2147352567, 'Exception occurred.', (u"Unexpected >> Python Erro >> >> r: AttributeError: 'module' object has no attribute 'VARIANT'\n", >> u'Python COM S >> >> erver Internal Error', None, 0L, -2147467259)) >> >> >>>>> >> | >> >> I have installed comtypes 0.6.2. Running Python 2.6.6 >> >> >> >> ______________________________**_________________ >> python-win32 mailing list >> python-win32 at python.org >> http://mail.python.org/**mailman/listinfo/python-win32 >> >> > ______________________________**_________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/**mailman/listinfo/python-win32 > -- Best regards, Paul Hemans paul_hemans at laberg.com.au LABERG Pty Ltd (02) 4889 9441 www.laberg.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: From mhammond at skippinet.com.au Mon Aug 6 08:07:18 2012 From: mhammond at skippinet.com.au (Mark Hammond) Date: Mon, 06 Aug 2012 16:07:18 +1000 Subject: [python-win32] Python COM server throws 'module' object has no attribute 'VARIANT' In-Reply-To: References: <501F20E3.7030501@gmail.com> Message-ID: <501F5F16.80207@skippinet.com.au> On 6/08/2012 3:58 PM, Paul Hemans wrote: > Hi Mark, > Thanks for the response. > > Here is what I am using to instantiate the server through python > >>> from comtypes.client import CreateObject > >>> cc= CreateObject("Compy.Connect") > >>> cc.Status() > > The com server also fails when being accessed from vbscript. > I have verified that both machines have comtypes 0.6.2 loaded. > > Win32com works on the same machine that comtypes works > >>> import win32com.client > >>> wcc = win32com.client.Dispatch("Compy.Connect") > >>> wcc.Status() > > When I run this on the machine that fails with comtypes I get: > Traceback (most recent call last): > File "", line 1, in > File "", line 2, in Status > pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, u'Python > COM Server Internal Error', u"Unexpected Python Error: AttributeError: > 'module' object has no attribute 'VARIANT'\n", None, 0, -2147467259), None) You should be able to register the COM object with "--debug" on the command-line - the message printed on registration should say "(with debugging)". Then, run win32traceutil and you should see the complete traceback from the server. Note that win32com.client.VARIANT was added quite recently to pywin32, so if the failing machine has an older version it will fail. HTH, Mark > > Do you have any suggestions as to what I can test? > > Thanks, > Paul > > On Mon, Aug 6, 2012 at 11:41 AM, Mark Hammond > wrote: > > I don't quite understand this code. The server is using win32com > (ie, not comtypes), but the client code seems to be using comtypes > rather than win32com (but it's hard to tell as the client code is > missing the imports etc). But at face value it appears one of the > machines might have an older version of comtypes installed. > > Mark > > > On 5/08/2012 11:13 PM, Paul Hemans wrote: > > Can someone tell me what is going wrong. The following works on one > machine but not on another. > > Here is a COM server implemented in Python: > > |from win32com.server.__exceptionimport COMException > > > import pythoncom > > import sys > > import os > > from string import Template > > import logging > > import logging.config > > > class Connector: > > _reg_clsctx_= pythoncom.CLSCTX_LOCAL_SERVER > > _reg_clsid_= "{0CE25AEB-1AFA-4DA7-97BD-__F93CDBFB376C}" > > _reg_desc_= "Python Test COM Server" > > _reg_progid_= "Compy.Connect" > > _public_methods_= ['Process', 'Status'] > > _public_attrs_= [] > > _readonly_attrs_= [] > > > def Process(self, what): > > pass > > > def Status(self): > > return Template(""" > > Current Directory: $dir > Installed: $script > PythonPATH: $pyPath > """).substitute(dir= os.getcwd(), > > script= os.path.abspath(__file__), > > pyPath= sys.path) > > > if __name__== '__main__': > > > import win32com.server.register > > win32com.server.register.__UseCommandLine(Connector) > > | > > It registers ok. When it is run it causes the following to occur > on the > production machine but NOT on the development box: > > |>>> cc= CreateObject("Compy.Connect") > > > cc.Status() > > > Traceback (most recent calllast): > > File "", line1, in > > File > "C:\Python26\lib\site-__packages\comtypes\client\__dynamic.py", line42, in _ > > _call__ > return self._obj._comobj.Invoke(self.___id, *args) > > File > "C:\Python26\lib\site-__packages\comtypes\automation.__py", > line717, in Invo > > > ke > raise COMError(hresult, text, details) > > _ctypes.COMError: (-2147352567 , 'Exception > occurred.', (u"Unexpected Python Erro > > r: AttributeError: 'module' object has no attribute > 'VARIANT'\n", u'Python COM S > > erver Internal Error', None, 0L, -2147467259 )) > > > > | > > I have installed comtypes 0.6.2. Running Python 2.6.6 > > > > _________________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/__mailman/listinfo/python-win32 > > > > _________________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/__mailman/listinfo/python-win32 > > > > > > -- > Best regards, > Paul Hemans > paul_hemans at laberg.com.au > LABERG Pty Ltd > (02) 4889 9441 > www.laberg.com.au > From paul_hemans at laberg.com.au Mon Aug 6 08:28:33 2012 From: paul_hemans at laberg.com.au (Paul Hemans) Date: Mon, 6 Aug 2012 16:28:33 +1000 Subject: [python-win32] Python COM server throws 'module' object has no attribute 'VARIANT' In-Reply-To: References: <501F20E3.7030501@gmail.com> Message-ID: Hi Mark, Installed pywin32-217.win32-py2.6.exe and then the problem was resolved. Thanks again. On Mon, Aug 6, 2012 at 3:58 PM, Paul Hemans wrote: > Hi Mark, > Thanks for the response. > > Here is what I am using to instantiate the server through python > >>> from comtypes.client import CreateObject > >>> cc= CreateObject("Compy.Connect") > >>> cc.Status() > > The com server also fails when being accessed from vbscript. > I have verified that both machines have comtypes 0.6.2 loaded. > > Win32com works on the same machine that comtypes works > >>> import win32com.client > >>> wcc = win32com.client.Dispatch("Compy.Connect") > >>> wcc.Status() > > When I run this on the machine that fails with comtypes I get: > Traceback (most recent call last): > File "", line 1, in > File "", line 2, in Status > pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, u'Python > COM Server Internal Error', u"Unexpected Python Error: AttributeError: > 'module' object has no attribute 'VARIANT'\n", None, 0, -2147467259), > None) > > Do you have any suggestions as to what I can test? > > Thanks, > Paul > > On Mon, Aug 6, 2012 at 11:41 AM, Mark Hammond wrote: > >> I don't quite understand this code. The server is using win32com (ie, >> not comtypes), but the client code seems to be using comtypes rather than >> win32com (but it's hard to tell as the client code is missing the imports >> etc). But at face value it appears one of the machines might have an older >> version of comtypes installed. >> >> Mark >> >> >> On 5/08/2012 11:13 PM, Paul Hemans wrote: >> >>> Can someone tell me what is going wrong. The following works on one >>> machine but not on another. >>> >>> Here is a COM server implemented in Python: >>> >>> |from win32com.server.**exceptionimport COMException >>> >>> >>> import pythoncom >>> >>> import sys >>> >>> import os >>> >>> from string import Template >>> >>> import logging >>> >>> import logging.config >>> >>> >>> class Connector: >>> >>> _reg_clsctx_= pythoncom.CLSCTX_LOCAL_SERVER >>> >>> _reg_clsid_= "{0CE25AEB-1AFA-4DA7-97BD-**F93CDBFB376C}" >>> >>> _reg_desc_= "Python Test COM Server" >>> >>> _reg_progid_= "Compy.Connect" >>> >>> _public_methods_= ['Process', 'Status'] >>> >>> _public_attrs_= [] >>> >>> _readonly_attrs_= [] >>> >>> >>> def Process(self, what): >>> >>> pass >>> >>> >>> def Status(self): >>> >>> return Template(""" >>> >>> Current Directory: $dir >>> Installed: $script >>> PythonPATH: $pyPath >>> """).substitute(dir= os.getcwd(), >>> >>> script= os.path.abspath(__file__), >>> >>> pyPath= sys.path) >>> >>> >>> if __name__== '__main__': >>> >>> >>> import win32com.server.register >>> >>> win32com.server.register.**UseCommandLine(Connector) >>> >>> | >>> >>> It registers ok. When it is run it causes the following to occur on the >>> production machine but NOT on the development box: >>> >>> |>>> cc= CreateObject("Compy.Connect") >>> >>> >>> cc.Status() >>>>>> >>>>> >>> Traceback (most recent calllast): >>> >>> File "", line1, in >>> >>> File "C:\Python26\lib\site-**packages\comtypes\client\**dynamic.py", >>> line42, in _ >>> >>> _call__ >>> return self._obj._comobj.Invoke(self.**_id, *args) >>> >>> File "C:\Python26\lib\site-**packages\comtypes\automation.**py", >>> line717, in Invo >>> >>> >>> ke >>> raise COMError(hresult, text, details) >>> >>> _ctypes.COMError: (-2147352567, 'Exception occurred.', (u"Unexpected >>> Python Erro >>> >>> r: AttributeError: 'module' object has no attribute 'VARIANT'\n", >>> u'Python COM S >>> >>> erver Internal Error', None, 0L, -2147467259)) >>> >>> >>>>>> >>> | >>> >>> I have installed comtypes 0.6.2. Running Python 2.6.6 >>> >>> >>> >>> ______________________________**_________________ >>> python-win32 mailing list >>> python-win32 at python.org >>> http://mail.python.org/**mailman/listinfo/python-win32 >>> >>> >> ______________________________**_________________ >> python-win32 mailing list >> python-win32 at python.org >> http://mail.python.org/**mailman/listinfo/python-win32 >> > > > > -- > Best regards, > Paul Hemans > > paul_hemans at laberg.com.au > > LABERG Pty Ltd > (02) 4889 9441 > > www.laberg.com.au > > -- Best regards, Paul Hemans paul_hemans at laberg.com.au LABERG Pty Ltd (02) 4889 9441 www.laberg.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: From janechen_1979 at yahoo.com Tue Aug 7 04:07:24 2012 From: janechen_1979 at yahoo.com (Jane Chen) Date: Mon, 6 Aug 2012 19:07:24 -0700 (PDT) Subject: [python-win32] creating disk image In-Reply-To: References: Message-ID: <1344305244.34337.YahooMailNeo@web164006.mail.gq1.yahoo.com> Thank you for your help,?Roger and Tim!? Problem solved. ?I realized that I can?simplify?my?problem?by using?win32file.ReadFile()to create a bin file. Thank you, Jane? ------------------------------- There's a FileStream class in \win32com\server\util.py that creates an IStream connected to a file. If you still need SHCreateStreamOnFileEx, put in a feature request on Sourceforge, and I'll try to get that function added to win32com.shell. ? ? Roger -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Tue Aug 7 19:23:05 2012 From: timr at probo.com (Tim Roberts) Date: Tue, 7 Aug 2012 10:23:05 -0700 Subject: [python-win32] creating disk image In-Reply-To: <1344305244.34337.YahooMailNeo@web164006.mail.gq1.yahoo.com> References: <1344305244.34337.YahooMailNeo@web164006.mail.gq1.yahoo.com> Message-ID: <50214EF9.6050107@probo.com> Jane Chen wrote: > Thank you for your help, Roger and Tim! > > Problem solved. I realized that I can simplify my problem by > using win32file.ReadFile()to create a bin file. You don't even need to go that far. There's nothing you can do with win32file.ReadFile that you cannot also do using perfectly normal Python file I/O, and that has the advantage of being cross-platform: binaryfile = open('myfile.bin','rb') buffer = binaryfile.read(4096) -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From radekholypublic at gmail.com Tue Aug 7 21:13:18 2012 From: radekholypublic at gmail.com (=?ISO-8859-1?Q?Radek_Hol=FD?=) Date: Tue, 7 Aug 2012 21:13:18 +0200 Subject: [python-win32] Power management functions in pywin32? Message-ID: Hello, are somewhere in pywin32 library implemented these functions: http://msdn.microsoft.com/en-us/library/windows/desktop/aa373163%28v=vs.85%29.aspx ? If not, can you please advise how to use for example function ``PowerSetActiveScheme`` via ``ctypes``? Or this is not suitable place for this question? I ask because this code does not work (I cannot cope with the GUID): >>> import ctypes >>> >>> class GUID(ctypes.Structure): ... _fields_ = [ ... ('Data1', ctypes.c_ulong), ... ('Data2', ctypes.c_ushort), ... ('Data3', ctypes.c_ushort), ... ('Data4', ctypes.c_ubyte*8), ... ] ... def __str__(self): ... return "{%08x-%04x-%04x-%s-%s}" % ( ... self.Data1, ... self.Data2, ... self.Data3, ... ''.join(["%02x" % d for d in self.Data4[:2]]), ... ''.join(["%02x" % d for d in self.Data4[2:]]), ... ) ... >>> array = ctypes.c_ubyte*8 >>> guid = GUID(ctypes.c_ulong(2709787400), 13633, 20395, array(188,129,247,21,86,242,11,74)) >>> ctypes.windll.powrprof.PowerSetActiveScheme(None, guid) Traceback (most recent call last): File "", line 1, in WindowsError: exception: access violation reading 0xA1841308 Thank you very much -- Radek Hol? Czech republic From rupole at hotmail.com Wed Aug 8 17:36:15 2012 From: rupole at hotmail.com (Roger Upole) Date: Wed, 8 Aug 2012 11:36:15 -0400 Subject: [python-win32] Power management functions in pywin32? References: Message-ID: Radek Hol? wrote: > Hello, > > are somewhere in pywin32 library implemented these functions: > http://msdn.microsoft.com/en-us/library/windows/desktop/aa373163%28v=vs.85%29.aspx > ? Most of these are not in Pywin32, except for GetPwrCapabilities. > If not, can you please advise how to use for example function > ``PowerSetActiveScheme`` via ``ctypes``? Or this is not suitable place > for this question? It's not really OT here, as there is a good bit of general discussion regarding Python and Windows, not just Pywin32. There's also a ctypes mailing list: https://lists.sourceforge.net/lists/listinfo/ctypes-users Roger From janechen_1979 at yahoo.com Wed Aug 8 20:09:15 2012 From: janechen_1979 at yahoo.com (Jane Chen) Date: Wed, 8 Aug 2012 11:09:15 -0700 (PDT) Subject: [python-win32] creating disk image In-Reply-To: References: Message-ID: <1344449355.64760.YahooMailNeo@web164001.mail.gq1.yahoo.com> Cool. Thank you Tim! Jane Chen wrote: > Thank you for your help, Roger and Tim! > > Problem solved.? I realized that I can simplify my problem by > using win32file.ReadFile()to create a bin file. You don't even need to go that far.? There's nothing you can do with win32file.ReadFile that you cannot also do using perfectly normal Python file I/O, and that has the advantage of being cross-platform: ? ? binaryfile = open('myfile.bin','rb') ? ? buffer = binaryfile.read(4096) -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. ------------------------------ -------------- next part -------------- An HTML attachment was scrubbed... URL: From janechen_1979 at yahoo.com Wed Aug 8 20:07:29 2012 From: janechen_1979 at yahoo.com (Jane Chen) Date: Wed, 8 Aug 2012 11:07:29 -0700 (PDT) Subject: [python-win32] 8G USB sector number In-Reply-To: References: Message-ID: <1344449249.73515.YahooMailNeo@web164004.mail.gq1.yahoo.com> Hi all, I would like to get total sector number of my disk. However, I found that I cannot get 8G sectors because of the buffer size. I only got 4G. buf_fmt='LL' buf_size=struct.calcsize(buf_fmt) buf=win32file.DeviceIoControl(h, winioctlcon.IOCTL_DISK_GET_LENGTH_INFO, None, buf_size, None) Could someone please tell me how to get the total sector number? Thank you, Jane -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Wed Aug 8 21:32:55 2012 From: timr at probo.com (Tim Roberts) Date: Wed, 8 Aug 2012 12:32:55 -0700 Subject: [python-win32] 8G USB sector number In-Reply-To: <1344449249.73515.YahooMailNeo@web164004.mail.gq1.yahoo.com> References: <1344449249.73515.YahooMailNeo@web164004.mail.gq1.yahoo.com> Message-ID: <5022BEE7.7060908@probo.com> Jane Chen wrote: > Hi all, > I would like to get total sector number of my disk. However, I found that I cannot get 8G sectors because of the buffer size. > I only got 4G. > > buf_fmt='LL' > buf_size=struct.calcsize(buf_fmt) > buf=win32file.DeviceIoControl(h, winioctlcon.IOCTL_DISK_GET_LENGTH_INFO, None, buf_size, None) > Could someone please tell me how to get the total sector number? I'm not sure what you mean here. IOCTL_DISK_GET_LENGTH_INFO doesn't return sectors -- it returns bytes, and it returns them as a 64-bit integer. That will hold almost 2 exabytes, about a million times larger than any hard disks that exist today. If you follow that sequence with print struct.unpack('Q',buf)[0] you should see the length in bytes. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From radekholypublic at gmail.com Thu Aug 9 08:56:59 2012 From: radekholypublic at gmail.com (=?ISO-8859-1?Q?Radek_Hol=FD?=) Date: Thu, 9 Aug 2012 08:56:59 +0200 Subject: [python-win32] Power management functions in pywin32? In-Reply-To: References: Message-ID: 2012/8/8 Roger Upole : > It's not really OT here, as there is a good bit of general discussion > regarding Python and Windows, not just Pywin32. > There's also a ctypes mailing list: > https://lists.sourceforge.net/lists/listinfo/ctypes-users Thank you very much, I'll try this discussion. However, I have discovered that the cause of the error is that I do not pass the pointer. So the correct code is: >>> import ctypes >>> class GUID(ctypes.Structure): ... _fields_ = [ ... ('Data1', ctypes.c_ulong), ... ('Data2', ctypes.c_ushort), ... ('Data3', ctypes.c_ushort), ... ('Data4', ctypes.c_ubyte*8), ... ] ... def __str__(self): ... return "{%08x-%04x-%04x-%s-%s}" % ( ... self.Data1, ... self.Data2, ... self.Data3, ... ''.join(["%02x" % d for d in self.Data4[:2]]), ... ''.join(["%02x" % d for d in self.Data4[2:]]), ... ) ... >>> array = ctypes.c_ubyte*8 >>> guid = GUID(ctypes.c_ulong(2709787400), 13633, 20395, array(188,129,247,21,86,242,11,74)) >>> ctypes.windll.powrprof.PowerSetActiveScheme(None, ctypes.byref(guid)) But there still must be a bug in the GUID class, because calling the function ``PowerGetActiveScheme`` I do not receive the same GUID. -- Radek Hol? Czech republic From janechen_1979 at yahoo.com Thu Aug 9 23:55:04 2012 From: janechen_1979 at yahoo.com (Jane Chen) Date: Thu, 9 Aug 2012 14:55:04 -0700 (PDT) Subject: [python-win32] 8G USB sector number In-Reply-To: References: Message-ID: <1344549304.98191.YahooMailNeo@web164001.mail.gq1.yahoo.com> My bad. I should use?'Q' instead of 'LL'. Thank you Tim! Jane Jane Chen wrote: > Hi all, > I would like to get total sector number of my disk. However, I found that I cannot get 8G sectors because of the buffer size. >? I only got 4G. >? >? ? ? ? buf_fmt='LL'? ? ? ? ? ? ? ? ? ? ? >? ? ? ? buf_size=struct.calcsize(buf_fmt) >? ? ? ? buf=win32file.DeviceIoControl(h, winioctlcon.IOCTL_DISK_GET_LENGTH_INFO, None, buf_size, None) > Could someone please tell me how to get the total sector number? I'm not sure what you mean here.? IOCTL_DISK_GET_LENGTH_INFO doesn't return sectors -- it returns bytes, and it returns them as a 64-bit integer.? That will hold almost 2 exabytes, about a million times larger than any hard disks that exist today. If you follow that sequence with ? ? print struct.unpack('Q',buf)[0] you should see the length in bytes. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sachin.s at nsn.com Thu Aug 23 11:27:11 2012 From: sachin.s at nsn.com (S, Sachin (NSN - IN/Bangalore)) Date: Thu, 23 Aug 2012 17:27:11 +0800 Subject: [python-win32] AccessDB 2007 Message-ID: <6CB66254BEA4AD42B4BE7BECC123D33C019531C0@SGSIEXC025.nsn-intra.net> Hi, I am facing some problems while accessing the Microsoft Access Database 2007, using win32com. The code and errors are given below. I also tried the steps in the link but to no avail: http://www.microsoft.com/en-us/download/confirmation.aspx?id=23734 Could you help, or also if you know of a any other way of accessing the database using the win32com module. Version: ActivePython 2.7.2.5 (ActiveState Software Inc.) based on Python 2.7.2 (default, Jun 24 2011, 12:22:14) [MSC v.1500 64 bit (AMD64)] on win32 Operating System: Windows 7 Code: try: import sys from win32com.client import Dispatch except ImportError as e: print e sys.exit(1) if __name__ == '__main__': data_source = "C:\\temp\\Database1.accdb" access = Dispatch('ADODB.Connection') access.Open('PROVIDER=Microsoft.ACE.OLEDB.12.0;Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=C:\\temp\\Database1.accdb;') Error: C:\> a_db.py Traceback (most recent call last): File "D:\Data\Python Scripts\For the heck of sharepoint\a_db.py", line 11, in access.Open('PROVIDER=Microsoft.ACE.OLEDB.12.0;Driver={Microsoft Access Driver (*.mdb, *.accdb)} ;DBQ=C:\\temp\\Database1.accdb;') File "", line 3, in Open File "C:\ActivePython27\lib\site-packages\win32com\client\dynamic.py", line 276, in _ApplyTypes_ result = self._oleobj_.InvokeTypes(*(dispid, LCID, wFlags, retType, argTypes) + args) pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, u'ADODB.Connection', u'Provider canno t be found. It may not be properly installed.', u'C:\\Windows\\HELP\\ADO270.CHM', 1240655, -21468245 82), None) From shivisi at nana10.co.il Thu Aug 23 13:40:12 2012 From: shivisi at nana10.co.il (Zev Spitz) Date: Thu, 23 Aug 2012 14:40:12 +0300 Subject: [python-win32] AccessDB 2007 (S, Sachin (NSN - IN/Bangalore)) In-Reply-To: References: Message-ID: An HTML attachment was scrubbed... URL: From vernondcole at gmail.com Thu Aug 23 16:31:06 2012 From: vernondcole at gmail.com (Vernon Cole) Date: Thu, 23 Aug 2012 08:31:06 -0600 Subject: [python-win32] AccessDB 2007 In-Reply-To: <6CB66254BEA4AD42B4BE7BECC123D33C019531C0@SGSIEXC025.nsn-intra.net> References: <6CB66254BEA4AD42B4BE7BECC123D33C019531C0@SGSIEXC025.nsn-intra.net> Message-ID: Dear S.: You do have the correct name for the 64-bit Access data provider, and you have downloaded it from the correct place. I suspect that the problem could be that your connect string has both the ADO syntax ("PROVIDER=") and ODBC syntax ("DRIVER=") at the same time. You should probably eliminate the "driver=" clause. As for another way of accessing the database, you could make use of adodbapi. It does the Dispatch('ADODB.Connection') and all that for you. I am not sure which version of pywin32 (and therefore which version of adodbapi) Active State is including in their package at the moment, but anything recent should work. If in doubt, you can get the latest versions at http://sourceforge.net/projects/pywin32 and/or the complete test and sample code at http://sourceforge.net/projects/adodbapi . The latter also includes is64bit.py to sense which provider you need. I include the following as a suggestion... import is64bit # assume we are in the adodbapi.test folder import adodbapi print adodbapi.version _accessdatasource = "test.mdb" if is64bit.Python(): provider = "Microsoft.ACE.OLEDB.12.0" else: provider = "Microsoft.Jet.OLEDB.4.0" connStrAccess = "Provider=%s;Data Source=%s" % (provider,_accessdatasource) print connStrAccess _table_name= 'Products' #create the connection con = adodbapi.connect(connStrAccess) #make a cursor on the connection c = con.cursor() #run an SQL statement on the cursor sql = 'select * from %s' % _table_name c.execute(sql) #get the results (but limit the number) using normal dbapi method db = c.fetchmany(5) #print them for rec in db: print rec #or, using the cursor as an iterator, so you don't need to call c.fetch* print repr(c.next()) c.close() con.close() adodbapi v2.4.2.2 Provider=Microsoft.ACE.OLEDB.12.0;Data Source=test.mdb ('1', 'Widgit', '5.0', '15.1234', '2009-01-29 13:05:30') ('2', 'Thingamajig, Standard', '505.0', '0.1', '2009-01-29 15:05:19') ('3', 'Left Handed Smoke Shifter', '1.0', '1000000', '2008-04-01 12:00:00') ('4', 'Gravel (Bulk)', '100.25', '32.4567', '2009-01-29 13:05:31') ('5', 'Tube, Drinking, Plastic, For cold liquids', '500000.0', '0.0013', '2009-01-29 13:05:32') -- Happy Pythoning, Vernon Cole On Thu, Aug 23, 2012 at 3:27 AM, S, Sachin (NSN - IN/Bangalore) < sachin.s at nsn.com> wrote: > Hi, > I am facing some problems while accessing the Microsoft Access Database > 2007, using win32com. The code and errors are given below. > I also tried the steps in the link but to no avail: > > http://www.microsoft.com/en-us/download/confirmation.aspx?id=23734 > > Could you help, or also if you know of a any other way of accessing the > database using the win32com module. > > Version: > ActivePython 2.7.2.5 (ActiveState Software Inc.) based on > Python 2.7.2 (default, Jun 24 2011, 12:22:14) [MSC v.1500 64 bit > (AMD64)] on win32 > > Operating System: Windows 7 > > Code: > try: > import sys > from win32com.client import Dispatch > except ImportError as e: > print e > sys.exit(1) > > if __name__ == '__main__': > data_source = "C:\\temp\\Database1.accdb" > access = Dispatch('ADODB.Connection') > access.Open('PROVIDER=Microsoft.ACE.OLEDB.12.0;Driver={Microsoft > Access Driver (*.mdb, *.accdb)};DBQ=C:\\temp\\Database1.accdb;') > > > Error: > > C:\> a_db.py > Traceback (most recent call last): > File "D:\Data\Python Scripts\For the heck of sharepoint\a_db.py", line > 11, in > access.Open('PROVIDER=Microsoft.ACE.OLEDB.12.0;Driver={Microsoft Access > Driver (*.mdb, *.accdb)} > ;DBQ=C:\\temp\\Database1.accdb;') > File "", line 3, in Open > File "C:\ActivePython27\lib\site-packages\win32com\client\dynamic.py", > line 276, in _ApplyTypes_ > result = self._oleobj_.InvokeTypes(*(dispid, LCID, wFlags, retType, > argTypes) + args) > pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, > u'ADODB.Connection', u'Provider canno > t be found. It may not be properly installed.', > u'C:\\Windows\\HELP\\ADO270.CHM', 1240655, -21468245 > 82), None) > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wsadkin at ParlanceCorp.com Thu Aug 23 20:00:19 2012 From: wsadkin at ParlanceCorp.com (Will Sadkin) Date: Thu, 23 Aug 2012 14:00:19 -0400 Subject: [python-win32] mxDateTime problem with embedded Python Message-ID: Hi all, I have a bit of a stumper. We have a C++ program in which we embed a release python interpreter, so that both our C++ and python programs can share a single codebase, written in Python. When building the program for debug, we always #undef _DEBUG while including Python.h, and always therefore link with python27.lib, and embed the *release* interpreter. (We did this so that we don't have to locate and/or build debug versions of the python interpreteter or extension dlls we may load (eg pyodbc, mx, etc. At least that was the theory.)) This embedded interpreter ends up importing a python package that tries to run the line: from mx import DateTime >From within the release C++ executable, this works just fine. But with the debug executable, it generates the following exception on that line: DLL load failed: A dynamic link library (DLL) initialization routine failed. I have a hypothesis as to why this is happening, bug am not sure how to confirm it, nor what to do about it. I suspect that the python27.dll is a statically linked dll, and so the embedded python interpreter I create can run on its own, regardless of the rest of the dlls linked into the rest of the executable. (This would be the only way I could see this working at all.) However, the executable containing that release Python interpreter is still linked with the debug Microsoft dlls to allow debugging, and I suspect that the (release) mxDateTime extension pyd is NOT statically linked, and so when it attempts to load within the embedded framework, it can't because one of the release DLLs *it* depends on (probably MSVCR90.dll, judging by the output from depends.exe) is not linked into the executable and/or conflicts with the MSVCR90D.dll that already is. As I said, I'm not sure how to confirm this, nor what to do about it, and I'm hoping Mark Hammond may have some suggestions. I have a different bug in this program that I really need to track down in the VS2008 debugger, but I am stymied because this problem occurs before I can get to the code in question, and so the program doesn't run the same way in both release and debug versions. Thanks in advance, /Will Sadkin Parlance Corporation From shivisi at nana10.co.il Thu Aug 23 18:29:34 2012 From: shivisi at nana10.co.il (Zev Spitz) Date: Thu, 23 Aug 2012 19:29:34 +0300 Subject: [python-win32] AccessDB 2007 (S, Sachin (NSN - IN/Bangalore)) In-Reply-To: <554ED400F994BF43AD3E6ED0328200BA0A8638E2@whqembx03p.ad.sfwmd.gov> References: <554ED400F994BF43AD3E6ED0328200BA0A8638E2@whqembx03p.ad.sfwmd.gov> Message-ID: That connection string works if you're using the pyodbc library, which uses ODBC under the hood. The questioner is using win32com to get at the ADODB.Connection object, which uses a different connection string format. Zev Spitz On 8/23/2012 4:38 PM, Ahmed, Shakir wrote: > > You can try this connection string too: > > DBfile = 'path /mymdb.mdb? or ?path/myaccdb.accdb? > > conn = pyodbc.connect('DRIVER={Microsoft Access Driver (*.mdb, > *.accdb)};DBQ='+DBfile, autocommit=True) > > cursor = conn.cursor() > > *From:*python-win32-bounces+shahmed=sfwmd.gov at python.org > [mailto:python-win32-bounces+shahmed=sfwmd.gov at python.org] *On Behalf > Of *Zev Spitz > *Sent:* Thursday, August 23, 2012 7:40 AM > *To:* python-win32 at python.org > *Subject:* [python-win32] AccessDB 2007 (S, Sachin (NSN - IN/Bangalore)) > > A connection string for ADO for Access looks like this: > conn.Open('Provider=Microsoft.ACE.OLEDB.12.0;Data > Source=C:\\temp\\Database1.accdb') > > The other stuff looks like the connection string for an ODBC connection. > If you don't have Office 2007 or later installed, then you need the > download at the link you provided. Otherwise, you have no need for it. > > Zev Spitz > > On 8/23/2012 1:00 PM, python-win32-request at python.org > wrote: > > Send python-win32 mailing list submissions to > > python-win32 at python.org > > > > To subscribe or unsubscribe via the World Wide Web, visit > > http://mail.python.org/mailman/listinfo/python-win32 > > or, via email, send a message with subject or body 'help' to > > python-win32-request at python.org > > > > You can reach the person managing the list at > > python-win32-owner at python.org > > > > When replying, please edit your Subject line so it is more specific > > than "Re: Contents of python-win32 digest..." > > > > > > Today's Topics: > > > > 1. AccessDB 2007 (S, Sachin (NSN - IN/Bangalore)) > > > > > > ---------------------------------------------------------------------- > > > > Message: 1 > > Date: Thu, 23 Aug 2012 17:27:11 +0800 > > From: "S, Sachin (NSN - IN/Bangalore)" > > To: > > Subject: [python-win32] AccessDB 2007 > > Message-ID: > > <6CB66254BEA4AD42B4BE7BECC123D33C019531C0 at SGSIEXC025.nsn-intra.net> > > Content-Type: text/plain; charset="us-ascii" > > > > Hi, > > I am facing some problems while accessing the Microsoft Access Database > > 2007, using win32com. The code and errors are given below. > > I also tried the steps in the link but to no avail: > > > > http://www.microsoft.com/en-us/download/confirmation.aspx?id=23734 > > > > Could you help, or also if you know of a any other way of accessing the > > database using the win32com module. > > > > Version: > > ActivePython 2.7.2.5 (ActiveState Software Inc.) based on > > Python 2.7.2 (default, Jun 24 2011, 12:22:14) [MSC v.1500 64 bit > > (AMD64)] on win32 > > > > Operating System: Windows 7 > > > > Code: > > try: > > import sys > > from win32com.client import Dispatch > > except ImportError as e: > > print e > > sys.exit(1) > > > > if __name__ == '__main__': > > data_source = "C:\\temp\\Database1.accdb" > > access = Dispatch('ADODB.Connection') > > access.Open('PROVIDER=Microsoft.ACE.OLEDB.12.0;Driver={Microsoft > > Access Driver (*.mdb, *.accdb)};DBQ=C:\\temp\\Database1.accdb;') > > > > > > Error: > > > > C:\> a_db.py > > Traceback (most recent call last): > > File "D:\Data\Python Scripts\For the heck of sharepoint\a_db.py", line > > 11, in > > access.Open('PROVIDER=Microsoft.ACE.OLEDB.12.0;Driver={Microsoft Access > > Driver (*.mdb, *.accdb)} > > ;DBQ=C:\\temp\\Database1.accdb;') > > File "", line 3, in Open > > File "C:\ActivePython27\lib\site-packages\win32com\client\dynamic.py", > > line 276, in _ApplyTypes_ > > result = self._oleobj_.InvokeTypes(*(dispid, LCID, wFlags, retType, > > argTypes) + args) > > pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, > > u'ADODB.Connection', u'Provider canno > > t be found. It may not be properly installed.', > > u'C:\\Windows\\HELP\\ADO270.CHM', 1240655, -21468245 > > 82), None) > > > > > > ------------------------------ > > > > _______________________________________________ > > python-win32 mailing list > > python-win32 at python.org > > http://mail.python.org/mailman/listinfo/python-win32 > > > > > > End of python-win32 Digest, Vol 113, Issue 12 > > ********************************************* > > > > > > > > We value your opinion. Please take a few minutes to share your > comments on the service you received from the District by clicking on > this link > . From skippy.hammond at gmail.com Fri Aug 24 04:15:06 2012 From: skippy.hammond at gmail.com (Mark Hammond) Date: Fri, 24 Aug 2012 12:15:06 +1000 Subject: [python-win32] mxDateTime problem with embedded Python In-Reply-To: References: Message-ID: <5036E3AA.6080903@gmail.com> On 24/08/2012 4:00 AM, Will Sadkin wrote: > Hi all, > > I have a bit of a stumper. We have a C++ program in which we embed a > release python interpreter, so that both our C++ and python programs can > share a single codebase, written in Python. When building the program > for debug, we always #undef _DEBUG while including Python.h, and always > therefore link with python27.lib, and embed the *release* interpreter. There are other symbols - it looks like you want to ensure DEBUG also isn't set and that NDEBUG is. > (We did this so that we don't have to locate and/or build debug versions > of the python interpreteter or extension dlls we may load (eg pyodbc, > mx, etc. At least that was the theory.)) > > This embedded interpreter ends up importing a python package that tries > to run the line: > > from mx import DateTime > >>From within the release C++ executable, this works just fine. But with > the debug executable, it generates the following exception on that line: > > DLL load failed: A dynamic link library (DLL) initialization routine > failed. > > I have a hypothesis as to why this is happening, bug am not sure how to > confirm it, nor what to do about it. > I suspect that the python27.dll is a statically linked dll, I'm not sure what you mean here - if you are talking about the linkage of the CRT, then it is not static - Python uses the DLL version of the CRT. You should be able to confirm this with depends.exe, and also by looking at the "output" tab of MSVC - it should report the CRT being loaded as python27.dll loads. and so the > embedded python interpreter I create can run on its own, regardless of > the rest of the dlls linked into the rest of the executable. (This > would be the only way I could see this working at all.) However, the > executable containing that release Python interpreter is still linked > with the debug Microsoft dlls to allow debugging, and I suspect that the > (release) mxDateTime extension pyd is NOT statically linked, and so when > it attempts to load within the embedded framework, it can't because one > of the release DLLs *it* depends on (probably MSVCR90.dll, judging by > the output from depends.exe) is not linked into the executable and/or > conflicts with the MSVCR90D.dll that already is. That shouldn't be a problem - if all Python components are linked against the same CRT, life should be OK even if the embedding component uses a different CRT. Unless, of course, that embedding component attempts to directly call Python... > > As I said, I'm not sure how to confirm this, nor what to do about it, > and I'm hoping Mark Hammond may have some suggestions. > I have a different bug in this program that I really need to track down > in the VS2008 debugger, but I am stymied because this problem occurs > before I can get to the code in question, and so the program doesn't run > the same way in both release and debug versions. Also note that it might be useful to simply change your release build to not optimize and to include debug symbols - that should let you step through the release version and avoids mixing-and-matching CRT versions. HTH, Mark > > Thanks in advance, > /Will Sadkin > Parlance Corporation > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > From wsadkin at ParlanceCorp.com Sat Aug 25 03:28:59 2012 From: wsadkin at ParlanceCorp.com (Will Sadkin) Date: Fri, 24 Aug 2012 21:28:59 -0400 Subject: [python-win32] mxDateTime problem with embedded Python In-Reply-To: <5036E3AA.6080903@gmail.com> References: <5036E3AA.6080903@gmail.com> Message-ID: On 24/08/2012 4:00 AM, Will Sadkin wrote: >> Hi all, >> >> I have a bit of a stumper. We have a C++ program in which we embed a >> release python interpreter, so that both our C++ and python programs >> can share a single codebase, written in Python. When building the >> program for debug, we always #undef _DEBUG while including Python.h, >> and always therefore link with python27.lib, and embed the *release* interpreter. > There are other symbols - it looks like you want to ensure DEBUG also isn't set and that NDEBUG is. I tried this, but it made no difference. >> (We did this so that we don't have to locate and/or build debug >> versions of the python interpreteter or extension dlls we may load (eg >> pyodbc, mx, etc. At least that was the theory.)) >> >> This embedded interpreter ends up importing a python package that >> tries to run the line: >> >> from mx import DateTime >> >> From within the release C++ executable, this works just fine. But >> with the debug executable, it generates the following exception on that line: >> >> DLL load failed: A dynamic link library (DLL) initialization >> routine failed. >> >> I have a hypothesis as to why this is happening, bug am not sure how >> to confirm it, nor what to do about it. >> I suspect that the python27.dll is a statically linked dll, > > I'm not sure what you mean here - if you are talking about the linkage of the > CRT, then it is not static - Python uses the DLL version of the CRT. You should be able > to confirm this with depends.exe, and also by looking at the "output" tab of MSVC - > it should report the CRT being loaded as python27.dll loads. Ok, here is what the output window of the attached debugger says as the pyd file loads (I'm running a 32bit version of python27 on my 64bit laptop, which is why the paths all have SysWOW64 and x86 in them, but normally this is running on a 32bit machine.): 'BuildServ.exe': Loaded 'C:\Program Files (x86)\Python27\Lib\site-packages\mx\DateTime\mxDateTime\mxDateTime.pyd', Binary was not built with debug information. 'BuildServ.exe': Loaded 'C:\Windows\SysWOW64\msvcr90.dll', Symbols loaded. 'BuildServ.exe': Unloaded 'C:\Program Files (x86)\Python27\Lib\site-packages\mx\DateTime\mxDateTime\mxDateTime.pyd' 'BuildServ.exe': Unloaded 'C:\Windows\SysWOW64\msvcr90.dll' And yet the pyd import generates the DLL load failure above. [...] > That shouldn't be a problem - if all Python components are linked against the > same CRT, life should be OK even if the embedding component uses a different CRT. > Unless, of course, that embedding component attempts to directly call Python... I'm pretty sure I'm not, which leaves me completely mystified as to why mxDateTime won't Initialize properly in my debug executable... > Also note that it might be useful to simply change your release build to not optimize > and to include debug symbols - that should let you step through the release version > and avoids mixing-and-matching CRT versions. I had tried this before with no success, but I took your advice, and finally figured out how to get symbols and source code access for my release executable, and then tracked down my other bug. Your suggestion makes me wonder what the point of debug executables at all if one can do this, but assuming that there are somethings you can do with a debug exe that you can't with a release exe, I'd still like to know why the debug exe can't load mxDateTime! Regards, /Will From skippy.hammond at gmail.com Sat Aug 25 07:59:57 2012 From: skippy.hammond at gmail.com (Mark Hammond) Date: Sat, 25 Aug 2012 15:59:57 +1000 Subject: [python-win32] mxDateTime problem with embedded Python In-Reply-To: References: <5036E3AA.6080903@gmail.com> Message-ID: <503869DD.6080504@gmail.com> On 25/08/2012 11:28 AM, Will Sadkin wrote: > On 24/08/2012 4:00 AM, Will Sadkin wrote: >>> Hi all, >>> >>> I have a bit of a stumper. We have a C++ program in which we embed a > >>> release python interpreter, so that both our C++ and python programs >>> can share a single codebase, written in Python. When building the >>> program for debug, we always #undef _DEBUG while including Python.h, >>> and always therefore link with python27.lib, and embed the *release* > interpreter. > >> There are other symbols - it looks like you want to ensure DEBUG also > isn't set and that NDEBUG is. > > I tried this, but it made no difference. > >>> (We did this so that we don't have to locate and/or build debug >>> versions of the python interpreteter or extension dlls we may load > (eg >>> pyodbc, mx, etc. At least that was the theory.)) >>> >>> This embedded interpreter ends up importing a python package that >>> tries to run the line: >>> >>> from mx import DateTime >>> >>> From within the release C++ executable, this works just fine. But >>> with the debug executable, it generates the following exception on > that line: >>> >>> DLL load failed: A dynamic link library (DLL) initialization >>> routine failed. >>> >>> I have a hypothesis as to why this is happening, bug am not sure how >>> to confirm it, nor what to do about it. >>> I suspect that the python27.dll is a statically linked dll, >> >> I'm not sure what you mean here - if you are talking about the linkage > of the >> CRT, then it is not static - Python uses the DLL version of the CRT. > You should be able >> to confirm this with depends.exe, and also by looking at the "output" > tab of MSVC - >> it should report the CRT being loaded as python27.dll loads. > > Ok, here is what the output window of the attached debugger says as the > pyd file > loads (I'm running a 32bit version of python27 on my 64bit laptop, which > is why the > paths all have SysWOW64 and x86 in them, but normally this is running on > a 32bit machine.): > > 'BuildServ.exe': Loaded 'C:\Program Files > (x86)\Python27\Lib\site-packages\mx\DateTime\mxDateTime\mxDateTime.pyd', > Binary was not built with debug information. > 'BuildServ.exe': Loaded 'C:\Windows\SysWOW64\msvcr90.dll', Symbols > loaded. > 'BuildServ.exe': Unloaded 'C:\Program Files > (x86)\Python27\Lib\site-packages\mx\DateTime\mxDateTime\mxDateTime.pyd' > 'BuildServ.exe': Unloaded 'C:\Windows\SysWOW64\msvcr90.dll' > > And yet the pyd import generates the DLL load failure above. > > [...] >> That shouldn't be a problem - if all Python components are linked > against the >> same CRT, life should be OK even if the embedding component uses a > different CRT. >> Unless, of course, that embedding component attempts to directly call > Python... > > I'm pretty sure I'm not, which leaves me completely mystified as to why > mxDateTime won't > Initialize properly in my debug executable... > >> Also note that it might be useful to simply change your release build > to not optimize >> and to include debug symbols - that should let you step through the > release version >> and avoids mixing-and-matching CRT versions. > > I had tried this before with no success, but I took your advice, and > finally figured out > how to get symbols and source code access for my release executable, and > then tracked down > my other bug. Your suggestion makes me wonder what the point of debug > executables at all > if one can do this, but assuming that there are somethings you can do > with a debug exe that > you can't with a release exe, I'd still like to know why the debug exe > can't load mxDateTime! I just realized that is going to be due to the joy of manifests. The Python DLL goes to some effort so that .pyd modules don't need to declare in their manifest that they use the CRT - however, that only works when the pyd uses the same CRT as Python itself. Python is almost certainly using the debug CRT (but as your copy of the output from the debugger didn't show the Python DLL loading, I can't be 100% sure of that), hence mxDateTime attempting to use that CRT without having it declared in the manifest failed. The manifest story sucks - fortunately Python 3.3 and later will not suffer that problem as VS2010 dropped the requirement for the CRT to be an "assembly" and hence requiring an entry in the manifest. Mark From kenneth.chin at codebless.com Sun Aug 26 18:32:25 2012 From: kenneth.chin at codebless.com (Kenneth Chin) Date: Mon, 27 Aug 2012 00:32:25 +0800 Subject: [python-win32] adodbapi COM Refresh clears Parameters Message-ID: Hi, I have developed a Windows app using Python to access Visual FoxPro database using OLE DB Provider. Whenever I use parameterized query, it failed with the following error: (-2147352567, 'Exception occurred.', (0, u'ADODB.Parameters', u'Item cannot be found in the collection corresponding to the requested name or ordinal.', u'C:\\WINDOWS\\HELP\\ADO270.CHM', 1240649, -2146825023), None) I noticed that adodbapi._buildADOparameterList() invokes self.cmd.Parameters.Refresh(). After Refresh() is called, the Parameters.Count() becomes 0. When I comment out this and forced adodbapi to manually build the parameter list, it works. Can adodbapi provide some ways to configure so that it has an option to always build the parameter list manually? As an additional note, the original adodbapi (i.e. with Refresh()) works fine with the OLEDB for Access 2007 [Provider=Microsoft.ACE.OLEDB.12.0], it just failed with OLEDB for VFP [Provider=VFPOLEDB.1] unless Refresh() is not called. Thanks. Regards, Kenneth Chin ----- Environment: Windows XP Pro SP3, Python 2.7.3, pywin32-217, adodbapi 2.4.2.2, OLEDB for VFP 9.0 [1] [1] Microsoft OLE DB Provider for Visual FoxPro 9.0 http://www.microsoft.com/en-us/download/details.aspx?id=14839 From vernondcole at gmail.com Mon Aug 27 06:56:57 2012 From: vernondcole at gmail.com (Vernon Cole) Date: Sun, 26 Aug 2012 22:56:57 -0600 Subject: [python-win32] adodbapi COM Refresh clears Parameters In-Reply-To: References: Message-ID: Kenneth: Sounds like a bug in the provider, doesn't it. I would not expect to see a patch, so it's a good thing you found a work-around. You asked if there might be a way to always build the parameter list manually. Perhaps we can add one. I happily adopt features from other db api implementations, and happily noticed in the latest version of mxodbc that they adopted one of mine. Mxodbc has a cursor method which might be some use here. From their current documentation: .executedirect(sqlcmd, parameters=()) This method works just like .execute(), except that no prepare step is issued and the sqlcmd is not cached. This can result in better performance with some ODBC driver setups, but also implies that Python type binding mode is used to bind the parameters. I guess that "Python type binding mode" means that the parameter list is built the same way as when .refresh() fails in ._buildADOparameterList(). ----------------------------------------------------------------------------------------------------- Dear Group: What are your thoughts about adding an .executedirect() method? What about a .prepare() method, too? -- Vernon On Sun, Aug 26, 2012 at 10:32 AM, Kenneth Chin wrote: > Hi, > > I have developed a Windows app using Python to access Visual FoxPro > database using OLE DB Provider. Whenever I use parameterized query, it > failed with the following error: > > (-2147352567, 'Exception occurred.', (0, u'ADODB.Parameters', u'Item > cannot be found in the collection corresponding to the requested name > or ordinal.', u'C:\\WINDOWS\\HELP\\ADO270.CHM', 1240649, -2146825023), > None) > > I noticed that adodbapi._buildADOparameterList() invokes > self.cmd.Parameters.Refresh(). After Refresh() is called, the > Parameters.Count() becomes 0. When I comment out this and forced > adodbapi to manually build the parameter list, it works. > > Can adodbapi provide some ways to configure so that it has an option > to always build the parameter list manually? > > As an additional note, the original adodbapi (i.e. with Refresh()) > works fine with the OLEDB for Access 2007 > [Provider=Microsoft.ACE.OLEDB.12.0], it just failed with OLEDB for VFP > [Provider=VFPOLEDB.1] unless Refresh() is not called. > > Thanks. > > Regards, > Kenneth Chin > > ----- > > Environment: Windows XP Pro SP3, Python 2.7.3, pywin32-217, adodbapi > 2.4.2.2, OLEDB for VFP 9.0 [1] > > [1] Microsoft OLE DB Provider for Visual FoxPro 9.0 > http://www.microsoft.com/en-us/download/details.aspx?id=14839 > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sachin.s at nsn.com Mon Aug 27 13:47:42 2012 From: sachin.s at nsn.com (S, Sachin (NSN - IN/Bangalore)) Date: Mon, 27 Aug 2012 19:47:42 +0800 Subject: [python-win32] AccessDB 2007 In-Reply-To: References: <6CB66254BEA4AD42B4BE7BECC123D33C019531C0@SGSIEXC025.nsn-intra.net> Message-ID: <6CB66254BEA4AD42B4BE7BECC123D33C01953E90@SGSIEXC025.nsn-intra.net> Dear Vernon, Thanks for your pointers, I will try the adodbapi. For now I have gone ahead with the much simpler version of COM. Here is something which works fine for my problem at hand. access = Dispatch('Access.Application') dbpath = 'ProntoDB.accdb' print dbpath dbengine = access.DBEngine workspace = dbengine.Workspaces(0) newdb = workspace.OpenDatabase(dbpath) recordSet = newdb.OpenRecordset('select * from Sheet1') print recordSet.Fields(headerText[v]).value #-- same way the update and adding new records works. One more question, in case you don't want me to open another thread. What kind of exceptions handling are needed while working with the MS-AccessDB ? Warm Regards Sachin From: ext Vernon Cole [mailto:vernondcole at gmail.com] Sent: Thursday, August 23, 2012 8:01 PM To: S, Sachin (NSN - IN/Bangalore) Cc: python-win32 at python.org Subject: Re: [python-win32] AccessDB 2007 Dear S.: You do have the correct name for the 64-bit Access data provider, and you have downloaded it from the correct place. I suspect that the problem could be that your connect string has both the ADO syntax ("PROVIDER=") and ODBC syntax ("DRIVER=") at the same time. You should probably eliminate the "driver=" clause. As for another way of accessing the database, you could make use of adodbapi. It does the Dispatch('ADODB.Connection') and all that for you. I am not sure which version of pywin32 (and therefore which version of adodbapi) Active State is including in their package at the moment, but anything recent should work. If in doubt, you can get the latest versions at http://sourceforge.net/projects/pywin32 and/or the complete test and sample code at http://sourceforge.net/projects/adodbapi . The latter also includes is64bit.py to sense which provider you need. I include the following as a suggestion... import is64bit # assume we are in the adodbapi.test folder import adodbapi print adodbapi.version _accessdatasource = "test.mdb" if is64bit.Python(): provider = "Microsoft.ACE.OLEDB.12.0" else: provider = "Microsoft.Jet.OLEDB.4.0" connStrAccess = "Provider=%s;Data Source=%s" % (provider,_accessdatasource) print connStrAccess _table_name= 'Products' #create the connection con = adodbapi.connect(connStrAccess) #make a cursor on the connection c = con.cursor() #run an SQL statement on the cursor sql = 'select * from %s' % _table_name c.execute(sql) #get the results (but limit the number) using normal dbapi method db = c.fetchmany(5) #print them for rec in db: print rec #or, using the cursor as an iterator, so you don't need to call c.fetch* print repr(c.next()) c.close() con.close() adodbapi v2.4.2.2 Provider=Microsoft.ACE.OLEDB.12.0;Data Source=test.mdb ('1', 'Widgit', '5.0', '15.1234', '2009-01-29 13:05:30') ('2', 'Thingamajig, Standard', '505.0', '0.1', '2009-01-29 15:05:19') ('3', 'Left Handed Smoke Shifter', '1.0', '1000000', '2008-04-01 12:00:00') ('4', 'Gravel (Bulk)', '100.25', '32.4567', '2009-01-29 13:05:31') ('5', 'Tube, Drinking, Plastic, For cold liquids', '500000.0', '0.0013', '2009-01-29 13:05:32') -- Happy Pythoning, Vernon Cole On Thu, Aug 23, 2012 at 3:27 AM, S, Sachin (NSN - IN/Bangalore) wrote: Hi, I am facing some problems while accessing the Microsoft Access Database 2007, using win32com. The code and errors are given below. I also tried the steps in the link but to no avail: http://www.microsoft.com/en-us/download/confirmation.aspx?id=23734 Could you help, or also if you know of a any other way of accessing the database using the win32com module. Version: ActivePython 2.7.2.5 (ActiveState Software Inc.) based on Python 2.7.2 (default, Jun 24 2011, 12:22:14) [MSC v.1500 64 bit (AMD64)] on win32 Operating System: Windows 7 Code: try: import sys from win32com.client import Dispatch except ImportError as e: print e sys.exit(1) if __name__ == '__main__': data_source = "C:\\temp\\Database1.accdb" access = Dispatch('ADODB.Connection') access.Open('PROVIDER=Microsoft.ACE.OLEDB.12.0;Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=C:\\temp\\Database1.accdb;') Error: C:\> a_db.py Traceback (most recent call last): File "D:\Data\Python Scripts\For the heck of sharepoint\a_db.py", line 11, in access.Open('PROVIDER=Microsoft.ACE.OLEDB.12.0;Driver={Microsoft Access Driver (*.mdb, *.accdb)} ;DBQ=C:\\temp\\Database1.accdb;') File "", line 3, in Open File "C:\ActivePython27\lib\site-packages\win32com\client\dynamic.py", line 276, in _ApplyTypes_ result = self._oleobj_.InvokeTypes(*(dispid, LCID, wFlags, retType, argTypes) + args) pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, u'ADODB.Connection', u'Provider canno t be found. It may not be properly installed.', u'C:\\Windows\\HELP\\ADO270.CHM', 1240655, -21468245 82), None) _______________________________________________ python-win32 mailing list python-win32 at python.org http://mail.python.org/mailman/listinfo/python-win32 -------------- next part -------------- An HTML attachment was scrubbed... URL: From kenneth.chin at codebless.com Tue Aug 28 06:00:40 2012 From: kenneth.chin at codebless.com (Kenneth Chin) Date: Tue, 28 Aug 2012 12:00:40 +0800 Subject: [python-win32] adodbapi COM Refresh clears Parameters In-Reply-To: References: Message-ID: Hi Vernon, Yes, you're right on both counts, it's likely to be a bug in the provider, and given that VFP is no longer in development, I doubt that a patch for such bugs will be made available. While implementing executedirect() will definitely help fix my issue here, but will it also mean that adodbapi will be less DB-API 2.0 compliant? If executedirect() is going to be like skipping Refresh() and building the parameter list directly, may I suggest to have some sort of variables like cursor.cmd, e.g. "cursor.refresh = True (default) | False" so that cursor.execute() still behaves the same way using Refresh() all normal cases and for cases like my buggy provider I can simply configure "cursor.refresh = False" before invoking cursor.execute(). That way the meanings of the execute() family can remain consistent. Regards, Kenneth On Mon, Aug 27, 2012 at 12:56 PM, Vernon Cole wrote: > Kenneth: > > Sounds like a bug in the provider, doesn't it. I would not expect to see > a patch, so it's a good thing you found a work-around. > > You asked if there might be a way to always build the parameter list > manually. Perhaps we can add one. I happily adopt features from other db > api implementations, and happily noticed in the latest version of mxodbc > that they adopted one of mine. Mxodbc has a cursor method which might be > some use here. From their current documentation: > > > .executedirect(sqlcmd, parameters=()) > This method works just like .execute(), except that no prepare step is > issued and the sqlcmd is not cached. This can result in better performance > with some ODBC driver setups, but also implies that Python type binding mode > is used to bind the parameters. > > > I guess that "Python type binding mode" means that the parameter list is > built the same way as when .refresh() fails in ._buildADOparameterList(). > ----------------------------------------------------------------------------------------------------- > Dear Group: > > What are your thoughts about adding an .executedirect() method? > > What about a .prepare() method, too? > -- > Vernon > > > On Sun, Aug 26, 2012 at 10:32 AM, Kenneth Chin > wrote: >> >> Hi, >> >> I have developed a Windows app using Python to access Visual FoxPro >> database using OLE DB Provider. Whenever I use parameterized query, it >> failed with the following error: >> >> (-2147352567, 'Exception occurred.', (0, u'ADODB.Parameters', u'Item >> cannot be found in the collection corresponding to the requested name >> or ordinal.', u'C:\\WINDOWS\\HELP\\ADO270.CHM', 1240649, -2146825023), >> None) >> >> I noticed that adodbapi._buildADOparameterList() invokes >> self.cmd.Parameters.Refresh(). After Refresh() is called, the >> Parameters.Count() becomes 0. When I comment out this and forced >> adodbapi to manually build the parameter list, it works. >> >> Can adodbapi provide some ways to configure so that it has an option >> to always build the parameter list manually? >> >> As an additional note, the original adodbapi (i.e. with Refresh()) >> works fine with the OLEDB for Access 2007 >> [Provider=Microsoft.ACE.OLEDB.12.0], it just failed with OLEDB for VFP >> [Provider=VFPOLEDB.1] unless Refresh() is not called. >> >> Thanks. >> >> Regards, >> Kenneth Chin >> >> ----- >> >> Environment: Windows XP Pro SP3, Python 2.7.3, pywin32-217, adodbapi >> 2.4.2.2, OLEDB for VFP 9.0 [1] >> >> [1] Microsoft OLE DB Provider for Visual FoxPro 9.0 >> http://www.microsoft.com/en-us/download/details.aspx?id=14839 >> _______________________________________________ >> python-win32 mailing list >> python-win32 at python.org >> http://mail.python.org/mailman/listinfo/python-win32 > > From dudley.carr at gmail.com Wed Aug 29 18:35:12 2012 From: dudley.carr at gmail.com (Dudley Carr) Date: Wed, 29 Aug 2012 09:35:12 -0700 Subject: [python-win32] Running makepy without a typelib Message-ID: The COM object I'm trying to access via Python has a CLSID and a ProgID registered, but no typelib as far as I can tell. Is it possible to use makepy without having a typelib? Having looked at makepy.py that doesn't seem to be the case. Thanks, Dudley -------------- next part -------------- An HTML attachment was scrubbed... URL: From rupole at hotmail.com Thu Aug 30 15:49:40 2012 From: rupole at hotmail.com (Roger Upole) Date: Thu, 30 Aug 2012 09:49:40 -0400 Subject: [python-win32] Running makepy without a typelib References: Message-ID: Dudley Carr wrote: > The COM object I'm trying to access via Python has a CLSID and a ProgID > registered, but no typelib as far as I can tell. Is it possible to use > makepy without having a typelib? Having looked at makepy.py that doesn't > seem to be the case. > > Thanks, > Dudley Makepy does require a typelib. However, there still may be type info embedded in a dll or exe even if it's not registered or in a separate .tlb file. Roger