web2py and paradox databases

29 views
Skip to first unread message

David S

unread,
Apr 11, 2013, 5:33:05 PM4/11/13
to
Today I discovered I'll need to read from a paradox database (http://en.wikipedia.org/wiki/Paradox_%28database%29) and pull some information from it into my application. I cannot change the data source to SQL or another format as doing that would require a complete hardware overhaul to replace some ancient scanning equipment from the mid 90s. From doing a little research, I've found the general suggestion is to try pyodbc and hope it works. There's also a few tools which seem to be able to convert from paradox to another database format. However these are all linux-based and compiling for Windows is untested and undocumented.

Is it possible DAL might be able to work with this setup, and if so what would the connections string look like?
Does anyone have experience with using web2py and paradox databases? Any suggestions?

Edit:
Forgot to mention these databases are currently receiving new data.

David

Niphlod

unread,
Apr 11, 2013, 6:25:03 PM4/11/13
to web...@googlegroups.com
this site comes to the rescue very often....

http://www.connectionstrings.com/paradox#intersolv-3-11-odbc

you can use the connection string just after mssql:// (e.g. mssql://{theconnectionstringhere}) if it has the same t-sql support .

As for seeking "official" support within web2py, I fear that no-one could actually test it if not you ....

David S

unread,
Apr 19, 2013, 11:13:18 AM4/19/13
to web...@googlegroups.com
Update:
I decided to keep the solution as easy as possible. I found a command line paradox db converter from here: http://www.dbf2002.com/paradox-converter/index.html and used subprocess.call() to it which converts the paradox db into a .csv. Then I used import_from_csv_file() to get the data.

The code is all of two lines:
subprocess.call('pxcnv.exe paradox.db paradox.csv')
db.table.import_from_csv_file(open('paradox.csv','rb'))

David

Niphlod

unread,
Apr 19, 2013, 11:23:49 AM4/19/13
to web...@googlegroups.com
lol. Nice solution, +1 for discarding unsupported dynosaur-ages lib.

Reply all
Reply to author
Forward
0 new messages