I work in an environment with a very poorly managed old Paradox system database. (I'm not an administrator.) I messed around using pyobbc to interact with our tables, and it seems that the main functions work. Here is some (working) test code:
import pyodbc
LOCATION = "C:\test"
cnxn = pyodbc.connect(r"Driver={{Microsoft Paradox Driver (*.db )\}};DriverID=538;Fil=Paradox 5.X;DefaultDir={0};Dbq={0};CollatingSequence=ASCII;".format(LOCATION), autocommit=True, readonly=True)
cursor = cnxn.cursor()
cursor.execute("select last, first from test")
row = cursor.fetchone()
print row
The problem is that most of our important tables will open in someoneβs Paradox interface at almost all times. I get this error whenever I try to make selectfrom one of these tables:
pyodbc.Error: ('HY000', "[HY000] [Microsoft][ODBC Paradox Driver] Could not lock
table 'test'; currently in use by user '(unknown)' on machine '(unknown)'. (-1304)
(SQLExecDirectW)")
This is obviously because pyodbc tries to lock the table when it is called cursor.execute(). This behavior makes sense because it cursor.execute()executes arbitrary SQL code and can modify the table.
, Paradox ( gui), , . , , .
pyodbc - , , select ? , , ?
, , .