Can Python adodbapi be used to connect to a paradox db? If yes what would the connection string look like?
A:
Yes, that depends on the Paradox ADODB driver you have installed in your windows.
Examples:
For Paradox 5.x, using Microsoft Jet OLEDB 4.0 driver:
r"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\myDb;
Extended Properties=Paradox 5.x;"
For Paradox 5.x, using Microsoft's Paradox ODBC Driver:
r"Driver={Microsoft Paradox Driver (*.db )};DriverID=538;Fil=Paradox 5.X;
DefaultDir=c:\pathToDb\;Dbq=c:\pathToDb\;CollatingSequence=ASCII;"
For Paradox 7.x, using Microsoft's Paradox ODBC Driver:
r"Provider=MSDASQL;Persist Security Info=False;Mode=Read;
Extended Properties='DSN=Paradox;DBQ=C:\myDb;DefaultDir=C:\myDb;DriverId=538;
FIL=Paradox 7.X;MaxBufferSize=2048;PageTimeout=600;';Initial Catalog=C:\myDb;"
Since you're probably going to use the ODBC driver anyway I strongly suggest you use pyodbc instead. It seems better supported than adodbapi and is also cross-platform.
Remember that you must point to the folder containing the .db files, not to the .db itself.
nosklo
2009-06-10 17:47:59