"A" <[EMAIL PROTECTED]> wrote:
>  Is there a module for using Paradox (.DB) files with Python?

Ladislav:

It has been a few years since I touched a Paradox file. However, unless someone 
suggests a better way, I'd say:  

1. Define an ODBC data source (or whatever it is that they're properly
called).

This is done in the Control Panel. Essentially, if you use the MS Paradox driver you 
will need to the make the DSN point to the folder in which your tables are stored.  

2. Use the ODBC module:

import odbc
s = odbc . odbc ( "vendors" )
cur = s . cursor ( )
cur . execute ( 'select * from vendors' )
0
while 1 :
        rec = cur.fetchmany(10)
        if not rec: break
        print rec

(Code cribbed and slightly simplified from 
http://www.python.org/windows/win32/odbc.html)

I just tried this against one of the Paradox tables that used to be included in Delphi 
distributions, and the darned thing worked.  

An alternative would be to use Python's COM facilities to get at ODBC.

Bill

_______________________________________________
ActivePython mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Other options: http://listserv.ActiveState.com/mailman/listinfo/ActivePython

Reply via email to