title: Is it possible to use pyodbc to read Paradox tables that are open in the Paradox gui?
body: <p>I'm working in a environment with a very poorly managed legacy Paradox database system. (I'm not the administrator.) I've been messing around with using pyodbc to interact with our tables, and the basic functionality seems to work. Here's some (working) test code:</p>
  
  <pre><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
  </code></pre>
  
  <p>The problem is that most of our important tables are going to be open in someone's Paradox GUI at pretty much all times. I get this error whenever I try to do a <code>select</code> from one of those tables:</p>
  
  <pre><code>pyodbc.Error: ('HY000', "[HY000] [Microsoft][ODBC Paradox Driver] Could not lock 
  table 'test'; currently in use by user '(unknown)' on machine '(unknown)'. (-1304) 
  (SQLExecDirectW)")
  </code></pre>
  
  <p>This is, obviously, because pyodbc tries to lock the table when <code>cursor.execute()</code> is called on it. This behavior makes perfect sense, since <code>cursor.execute()</code> runs arbitary SQL code and could change the table.</p>
  
  <p>However, Paradox itself (through its gui) seems to handle multiple users fine. It only gives you similar errors if you try to restructure the table while people are using it.</p>
  
  <p>Is there any way I can get pyodbc to use some sort of read-only mode, such that it doesn't have to lock the table when I'm just doing <code>select</code> and such? Or is locking a fundamental part of how it works that I'm not going to be able to get around?</p>
  
  <p>Solutions that would use other modules are also totally fine.</p>