[python-win32] Opening Access (mdb) database: ADODB.Connection - Der Provider kann nicht gefunden werden

2015-04-20 Thread Niemann, Hartmut
Hello!

I try to open and write an (Access 2000) mdb file, and get an error I cannot 
interpret.

This code as worked in the past (two months ago)  and works without 
modification on a different PC of a colleague, so chances are
my configuration misses a simple thing, a software package (update) or 
something other trivial.

My System is Win7,
Python 2.7.9 (default, Dec 10 2014, 12:28:03) [MSC v.1500 64 bit (AMD64)] on 
win32,
pywin32-219.win-amd64-py2.7.exe
Microsoft Office Access 2007 (12.0.6696.1000) SP3 MSO (12.0.6718.5000)

Could this be some 32-bit vs. 64-bit thing? (ATM I can not check whether my 
colleague still uses an older (32bit?) installation.)

this is the source

try:
print "Open ADOB.Connection"
ado = win32com.client.Dispatch("ADODB.Connection")
connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0; Data 
Source=\"%s\"" % filename   # Access 2003
#connectionstring = "Provider=Microsoft.ACE.OLEDB.12.0;Data 
Source=\"%s\"" % filename   # Access 2007
print "Open ADOB.Connection with '%s'" % connectionstring
ado.Open(connectionstring)
except pythoncom.com_error, (hr, msg, exc, arg):  # pylint: disable=E1101
print "The Access call failed with code %d: %s" % (hr, msg)
if exc is None:
print "There is no extended error information"
else:
wcode, source, text, helpFile, helpId, scode = exc
print "The source of the error is", source
print "The error message is", text
print "More info can be found in %s (id=%d)" % (helpFile, helpId)
raise
return ado

This is the result
--
Open ADOB.Connection with 'Provider=Microsoft.Jet.OLEDB.4.0; Data 
Source="out\Stoermeld-B97.mdb"'
The Access call failed with code -2147352567: Ausnahmefehler aufgetreten.
The source of the error is ADODB.Connection
The error message is Der Provider kann nicht gefunden werden.  Möglicherweise 
ist er nicht richtig installiert worden.
More info can be found in C:\WINDOWS\HELP\ADO270.CHM (id=1240655)
Traceback (most recent call last):
  File "D:\PRJ\DPS\bin\stoerungsmeldungen.py", line 1117, in 
options.opcid)
  File "D:\PRJ\DPS\bin\stoerungsmeldungen.py", line 893, in write_oms
myoms = omsdatabase.OMS(omsname)
  File "D:\PRJ\DPS\bin\omsdatabase.py", line 225, in __init__
self._ADOconnectionObject = access_open(filename)
  File "D:\PRJ\DPS\bin\omsdatabase.py", line 183, in access_open
ado.Open(connectionstring)
  File 
"C:\Python27\lib\site-packages\win32com\gen_py\B691E011-1797-432E-907A-4D8C69339129x0x6x1.py",
 line 3523, in Open
, UserID, Password, Options)
  File "C:\Python27\lib\site-packages\win32com\client\__init__.py", line 459, 
in _ApplyTypes_
self._oleobj_.InvokeTypes(dispid, 0, wFlags, retType, argTypes, *args),
pywintypes.com_error: (-2147352567, 'Ausnahmefehler aufgetreten.', (0, 
u'ADODB.Connection', u'Der Provider kann nicht gefunden werden.  
M\xf6glicherweise ist er
nicht richtig installiert worden.', u'C:\\WINDOWS\\HELP\\ADO270.CHM', 1240655, 
-2146824582), None)
-

if I try the ACE 12 string that should (according to some googling) belong to 
the JET module of Access 2007
which is installed on the PC (opening the mdb with double click works just 
fine), I get:
-
Open ADOB.Connection with 'Provider=Microsoft.ACE.OLEDB.12.0;Data 
Source="out\Stoermeld-B97.mdb"'
The Access call failed with code -2147352567: Ausnahmefehler aufgetreten.
The source of the error is ADODB.Connection
The error message is Der Provider kann nicht gefunden werden.  Möglicherweise 
ist er nicht richtig installiert worden.
More info can be found in C:\WINDOWS\HELP\ADO270.CHM (id=1240655)
Traceback (most recent call last):
  File "D:\PRJ\DPS\bin\stoerungsmeldungen.py", line 1117, in 
options.opcid)
  File "D:\PRJ\DPS\bin\stoerungsmeldungen.py", line 893, in write_oms
myoms = omsdatabase.OMS(omsname)
  File "D:\PRJ\DPS\bin\omsdatabase.py", line 225, in __init__
self._ADOconnectionObject = access_open(filename)
  File "D:\PRJ\DPS\bin\omsdatabase.py", line 183, in access_open
ado.Open(connectionstring)
  File 
"C:\Python27\lib\site-packages\win32com\gen_py\B691E011-1797-432E-907A-4D8C69339129x0x6x1.py",
 line 3523, in Open
, UserID, Password, Options)
  File "C:\Python27\lib\site-packages\win32com\client\__init__.py", line 459, 
in _ApplyTypes_
self._oleobj_.InvokeTypes(dispid, 0, wFlags, retType, argTypes, *args),
pywintypes.com_error: (-2147352567, 'Ausnahmefehler aufgetreten.', (0, 
u'ADODB.Connection', u'Der Provider kann nicht gefunden werden.  
M\xf6glicherweise ist er
nicht richtig installiert worden.', u'C:\\WINDOWS\\HELP\\ADO270.CHM', 1240655, 
-2146824582), None)
--

I must admit that I have little knowledge about COM and wrote this code
by copying and modyfiying code examples I found.
It worked rather well in the past, but now it fails for me (and still works for 
other people)

Re: [python-win32] Opening Access (mdb) database: ADODB.Connection - Der Provider kann nicht gefunden werden

2015-04-20 Thread Rod Person

On 04/20/2015 9:49 AM, Niemann, Hartmut wrote:


this is the source



try:

print "Open ADOB.Connection"

ado = win32com.client.Dispatch("ADODB.Connection")

connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0; Data 
Source=\"%s\"" % filename   # Access 2003


#connectionstring = "Provider=Microsoft.ACE.OLEDB.12.0;Data 
Source=\"%s\"" % filename   # Access 2007


print "Open ADOB.Connection with '%s'" % connectionstring

ado.Open(connectionstring)

except pythoncom.com_error, (hr, msg, exc, arg):  # pylint: 
disable=E1101


print "The Access call failed with code %d: %s" % (hr, msg)

if exc is None:

print "There is no extended error information"

else:

wcode, source, text, helpFile, helpId, scode = exc

print "The source of the error is", source

print "The error message is", text

print "More info can be found in %s (id=%d)" % (helpFile, 
helpId)


raise

return ado



This is the result

--

Open ADOB.Connection with 'Provider=Microsoft.Jet.OLEDB.4.0; Data 
Source="out\Stoermeld-B97.mdb"'


The Access call failed with code -2147352567: Ausnahmefehler aufgetreten.

The source of the error is ADODB.Connection

The error message is Der Provider kann nicht gefunden werden.  
Möglicherweise ist er nicht richtig installiert worden.




I don't read or speak German so my thought on what this error says could 
be wrong but, it looks like it is saying that the Data Provider is 
missing.  If so, you need Jet.OLEDB.4.0 providers install on the 
machine.  They should be install with Access 2000 but am assume you just 
have the mdb file.   Might want to check the MS site to see if you can 
download the provider without Access 2000.


--
Rod

"Times are bad. Children no longer obey their parents, and everyone is writing a 
book."
  -- Marcus Tullius Cicero(106 BC - 43 BC)



___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] Error R6034 when I import uuid

2015-04-20 Thread Tim Roberts
Blair Hall wrote:
>
>
>
> One ugly alternative would be to edit sys.path in your code before you
> start your imports.  If you remove everything but the Windows
> directories, that should solve the problem.
>
>
> I don't follow. Surely sys.path has nothing to do with it? It is the
> LoadLibrary("msvcr90") call from _cytpes.pyd that seems to be the
> problem here and that is not using the sys.path (or is it?).

Absolutely, yes.  DLLs are found through the path exactly like any other
executable.  You can read about the DLL search algorithm in excruciating
detail here, although this omits some of the ugly subtleties of the
side-by-side nonsense used by msvcr90 and friends:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms682586.aspx


> I have used py2exe on another project that creates an EXE. This
> project also imports uuid (it basically imports the same stuff I am
> using now, but for a different application). In that case, the
> manifest seems to work as expected. So, I wonder what is different in
> the case of my DLL? Well one thing that I can think of is that the
> problem arises when registering the DLL as a COM server, using
> regsvr32. Could it be that Windows does not know to look for the
> manifest in the right place because it is regsvr32 that is running?!

It's not that easy.  As I said, the manifest you have provided is not
actually connected to your DLL.  It merely lets the operating system
know about the runtime library that you have included.  If the DLL
search path comes to your folder, the fact that you have provided a
manifest means that the system is allowed to find your version of
msvcr90.  If there is someone else earlier in the search order that also
has one, it will find that one instead.

-- 
Tim Roberts, t...@probo.com
Providenza & Boekelheide, Inc.

___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] Opening Access (mdb) database: ADODB.Connection - Der Provider kann nicht gefunden werden

2015-04-20 Thread Vernon D. Cole
I also cannot read German, and also I guess that you do not have the
correct provider. There are numerous difficulties with 64 vs 32  bit
providers for Access (Jet) databases.

More information about providers can be found on the links in
http://adodbapi.sourceforge.net/quick_reference.pdf

I in reviewing my answer, I find that the link to the "hacked" 12.0
versions of the provider at http://shares.digvil.info/redis/ was broken, so
I repaired the site.
--
Vernon Cole


On Mon, Apr 20, 2015 at 8:15 AM, Rod Person  wrote:

>  On 04/20/2015 9:49 AM, Niemann, Hartmut wrote:
>
>  this is the source
>
> 
>
> try:
>
> print "Open ADOB.Connection"
>
> ado = win32com.client.Dispatch("ADODB.Connection")
>
> connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0; Data
> Source=\"%s\"" % filename   # Access 2003
>
> #connectionstring = "Provider=Microsoft.ACE.OLEDB.12.0;Data
> Source=\"%s\"" % filename   # Access 2007
>
> print "Open ADOB.Connection with '%s'" % connectionstring
>
> ado.Open(connectionstring)
>
> except pythoncom.com_error, (hr, msg, exc, arg):  # pylint:
> disable=E1101
>
> print "The Access call failed with code %d: %s" % (hr, msg)
>
> if exc is None:
>
> print "There is no extended error information"
>
> else:
>
> wcode, source, text, helpFile, helpId, scode = exc
>
> print "The source of the error is", source
>
> print "The error message is", text
>
> print "More info can be found in %s (id=%d)" % (helpFile,
> helpId)
>
> raise
>
> return ado
>
> 
>
> This is the result
>
> --
>
> Open ADOB.Connection with 'Provider=Microsoft.Jet.OLEDB.4.0; Data
> Source="out\Stoermeld-B97.mdb"'
>
> The Access call failed with code -2147352567: Ausnahmefehler aufgetreten.
>
> The source of the error is ADODB.Connection
>
> The error message is Der Provider kann nicht gefunden werden.
> Möglicherweise ist er nicht richtig installiert worden.
>
>
> I don't read or speak German so my thought on what this error says could
> be wrong but, it looks like it is saying that the Data Provider is
> missing.  If so, you need Jet.OLEDB.4.0 providers install on the machine.
> They should be install with Access 2000 but am assume you just have the mdb
> file.   Might want to check the MS site to see if you can download the
> provider without Access 2000.
>
> --
> Rod
>
> “Times are bad. Children no longer obey their parents, and everyone is 
> writing a book.”
>   -- Marcus Tullius Cicero(106 BC - 43 BC)
>
>
>
>
> ___
> python-win32 mailing list
> python-win32@python.org
> https://mail.python.org/mailman/listinfo/python-win32
>
>
___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] Opening Access (mdb) database: ADODB.Connection - Der Provider kann nicht gefunden werden

2015-04-20 Thread Vernon D. Cole
On Mon, Apr 20, 2015 at 7:49 AM, Niemann, Hartmut <
hartmut.niem...@siemens.com> wrote:

>  [...]
>
> Is this the best way to access an mdb database from python (2.7) or what
> would
>
> be preferred?
>
>
>
Rather than programming ADO by COM interface, you might find it easier or
more convenient to use the standard Python db-api interface provided by
sourceforge.net/projects/adodbapi .  It uses the same providers that you
are struggling with now (it calls the ADO COM interface for you) so it will
not help with your existing problem, unfortunately.
___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] Oldest Python version for pywin32?

2015-04-20 Thread Andreas Holtz
I am one 2.5 user, too.
Reason is, that thanks to 4Suite (which is a fantastic XML framework) we are 
bound to 2.5.
I didn't find a better XML framework for Python but it's not gonna developed 
further and will not be
ported to 3.x (reminds me of contacting Jeremy Kloth for a port to a newer 
Python version).

But on the other hand, I don't download PyWin regulary and stick with the 
version we are currently
using (214, I think). If a piece of software works fine (enough), there is no 
need to downloading a
newer version. So see it as a complement that people are happy with the 
software :-)

Vernon D. Cole schrieb am 15.04.2015 um 15:59:
> I concur.  I am one of the 100 downloads of 2.5 -- and the only reason I 
> download it is to test it,
> not to use it in production.  How many of the other downloaders are like me? 
> Most, I would bet.
> Dropping 2.5 would allow use of many Python3 features, since 2.6 has the 
> backports for them (print
> function, "{}".format(), byte literals, and especially "except ... as"). It 
> would simplify the
> Python code in the library.
> 
> On Wed, Apr 15, 2015 at 4:25 AM, Tim Golden  > wrote:
> 
> On 15/04/2015 10:11, Mark Hammond wrote:
> > Hi Tim,
> >Â  Â I still build for 2.5 and 3.1, but really only because they do still
> > build. If there's a reasonable reason to drop support for some I doubt
> > it will hurt many people - the sourceforge page should show you download
> > stats, but last I looked 2.5 was rarely used then, and that was some
> > time ago!
> 
> 
> FWIW the sf page for build 219 shows less than 100 downloads for 2.5/6
> and 3.1/2.
> 
> Unsuprisingly 2.7 dominates with 3,000 downloads at 32-bit (2,000 at
> 64-bit).
> 
> 3.3 comes in just over 100 and 3.4/5 each a few hundreds.
> 
> So I feel no particular compunction about dropping forward support for
> 2.6 and lower and 3.2 and lower. (Could say 2.5/3.1 but it's the same
> SDK level I think).
> 
> TJG
> ___
> python-win32 mailing list
> python-win32@python.org 
> https://mail.python.org/mailman/listinfo/python-win32
> 
> 
> 
> 
> ___
> python-win32 mailing list
> python-win32@python.org
> https://mail.python.org/mailman/listinfo/python-win32
> 
___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32