[egenix-users] ZmxODBC and DBFs

M.-A. Lemburg mal at egenix.com
Thu Jan 6 17:18:42 CET 2005


Erik Myllymaki wrote:
> Thanks for this.
> 
> I made a file DSN entery in the ODBC manageer and it seems to work fine 
> if my datasources are local (C: drive) but not if they are on a mapped 
> drive.
> 
> Any ideas on that one?

No. I would assume that locking is not efficient enough to
make this worthwhile.

If you only want to read from the file,
you could try to setup the connection as read-only. Some drivers
support this using DSN connection string attributes and there's also a
connection attribute for it... mxODBC.Windows.SQL.ATTR_ACCESS_MODE.

This may also work on a mapped drive since it doesn't
require locking.

You may also want to try to use the network file names instead
of the mapped driver file name to point to the file. That sometimes
makes a difference.

> 
> M.-A. Lemburg wrote:
> 
>> Erik Myllymaki wrote:
>>
>>> Any tips on how to make a connection with an ODBC conneciton to DBF 
>>> files?
>>
>>
>>
>> On Windows, you'd simply create a data source for the .dbf file.
>> The MS MDAC package comes with ODBC drivers for .dbf files which
>> can be used for this. The package is usually installed as part
>> of MS Office, but also available separately from MS. I think that
>> Win XP ships with the package preinstalled.
>>
>> It is also possible to create an ad-hoc connection using the
>> FILEDSN connection string attribute...
>>
>> Connection parameters (DSNs):
>>
>>     
>> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/odbcsqldriverconnect.asp 
>>
>>
>>     (scroll down to the comments section).
>>
>> A list of all the keywords you can use with MS SQL Server in the
>> connection string:
>>
>>        
>> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbcsql/od_odbc_d_4x4k.asp 
>>
>>
>> Example of a DSN-less connection string:
>>
>>     "DRIVER={SQL Server};SERVER=hrserver;UID=Smith;PWD=Sesame"
>>
>> Example of a File DSN strings:
>>
>>     "FILEDSN=HR_FDSN;UID=Smith;PWD=Sesame"
>>
> 
> 
> _______________________________________________________________________
> eGenix.com User Mailing List                     http://www.egenix.com/
> http://lists.egenix.com/mailman/listinfo/egenix-users

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Jan 06 2005)
 >>> Python/Zope Consulting and Support ...        http://www.egenix.com/
 >>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
 >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::



More information about the egenix-users mailing list