strange transliteration in win32com.client



Is this the place to ask a win32com.client question? I am a unix
person trying to run on windows, so I have little familiarity with
this module. I have this code:

import win32com.client

"""An Access connection"""

def connect(data_source, user, pwd, mdw):
connAccess = win32com.client.Dispatch(r'ADODB.Connection')
SOURCE=%s;USER ID=%s;PASSWORD=%s;Jet OLEDB:System Database=%s;"
% (data_source, user, pwd, mdw)
connAccess.Open(DSN)
return connAccess

I when I call this, running my program from the windows command line
on the C:\ drive, with data_source='\\Hqwhslfs001\office\risk oversight
\myaccessdb.mdb', which is the fully specified drive name, it comes
back with:

File "C:\Python25\lib\site-packages\win32com\client\dynamic.py",
line 258, in _ApplyTypes_
result = self._oleobj_.InvokeTypes(*(dispid, LCID, wFlags,
retType, argTypes) + args)
pywintypes.com_error: (-2147352567, 'Exception occurred.', (0,
'Microsoft JET Database Engine', "'c:\\Hqwhslfs001\\office\risk
oversight\\myaccess.mdb' is not a valid path. Make sure that the path
name is spelled correctly and that you are connected to the server on
which the file resides.", None, 5003044, -2147467259), None)

Please note the strange insertion of double slashes in the indicated
'not valid path.' Also the insertion of 'c:' and the strange leading
double quotation mark.

When I call it with data_source = 'V:\risk oversight\myassessdb.mdb',
which reflects how this same drive is mapped on my machine, I get:

File "C:\Python25\lib\site-packages\win32com\client\dynamic.py", line
258, in _ApplyTypes_
result = self._oleobj_.InvokeTypes(*(dispid, LCID, wFlags,
retType, argTypes) + args)
pywintypes.com_error: (-2147352567, 'Exception occurred.', (0,
'Microsoft JET Database Engine', "'v:\\\risk oversight\
\myaccessdb.mdb' is not a valid path. Make sure that the path name is
spelled correctly and that you are connected to the server on which
the file resides.", None, 5003044, -2147467259), None)

Note the weird transliteration of data_source. I am powerless to
understand this.

.



Relevant Pages

  • Re: ASP Database connection problem
    ... > Microsoft JET Database Engine error '80004005' ... Please reply to the newsgroup. ...
    (microsoft.public.inetserver.asp.general)
  • Re: Newbie Question 2
    ... In relation to the ASP file with ... > Microsoft JET Database Engine ... > 'Z:\Database' is not a valid path. ...
    (microsoft.public.inetserver.asp.general)
  • Re: Cannot back up
    ... Please insure it is a valid path and that you have permission to access" when I try to use the Windows XP backup utility. ...
    (microsoft.public.windowsxp.general)
  • Re: how to universally source files
    ... /a/b/c.txt/../d.txt isn't a valid path on Unix *or* Windows. ... Darren New / San Diego, CA, USA ...
    (comp.lang.tcl)
  • Re: ASP.NET Impersonation Works, ASP Classic doesnt
    ... Here is the exact error message and connection string: ... Microsoft JET Database Engine ...
    (microsoft.public.inetserver.iis.security)