SQL-Statement with Python

Tim Roberts timr at probo.com
Sat Jan 20 13:22:12 EST 2001


"Alex Martelli" <aleaxit at yahoo.com> wrote:
>
>Oops -- you're perfectly right!  Funny thing is that the code as I
>posted it *DOES* work -- dunno who's removing the extra backslashes,
>or why they don't hurt things.

For the most part, Windows doesn't care about redundant backslashes, except
at the very beginning of a filename.

C:\Dev [4]>> dir c:\windows\\\\system\gdi32.dll

 Volume in drive C is DURHAM
 Volume Serial Number is 3945-0106
 Directory of C:\WINDOWS\SYSTEM

GDI32    DLL       155,648  05-11-98  7:01p GDI32.DLL
         1 file(s)        155,648 bytes
         0 dir(s)        1,487.53 MB free
C:\Dev [5]>> 


>Note that this is *NOT* a case where forward slashes can be used
>instead of backward ones!  Changing the filename assignment to:
>
>filename = 'd:/mssdk/bin/wind.mdb'
>
>results in an exception on connection.Open:
>
>pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, 'Microsoft
>JET Database Engine', "Could not find file 'd:\\mssdk\\bin\\wind.mdb'.", 
>None, 5003024 , -2147467259), None)

Now, THIS surprises me greatly.  In virtually all of Windows (except for
the command shells), forward slashes work perfectly well.  I'll have to
remember this!
--
- Tim Roberts, timr at probo.com
  Providenza & Boekelheide, Inc.



More information about the Python-list mailing list