Note that there are some explanatory texts on larger screens.

plurals
  1. POPython dbfpy and FoxPro
    primarykey
    data
    text
    <p>Alright, I'm using an ancient database format here, dbf files. Don't ask why, just know a certain software decided to extend foxpro support because microsoft decided to extend foxpro support. Now, I'm getting the following error on a specific file. I have successfully loaded another file and I'm curious if there is something wrong with this database. I'm sure you probably need to look at the database to determine that, but its way to huge to post so I'll take what I can get. </p> <pre><code>Traceback (most recent call last): File "billsapi.py", line 250, in &lt;module&gt; x.getUsedGuns() File "billsapi.py", line 72, in getUsedGuns itemdb = dbf.Dbf('item.dbf', readOnly=True, ignoreErrors=True) File "C:\Python27\lib\site-packages\dbfpy\dbf.py", line 135, in __init__ self.header = self.HeaderClass.fromStream(self.stream) File "C:\Python27\lib\site-packages\dbfpy\header.py", line 127, in fromStream _fld = fields.lookupFor(_data[11]).fromString(_data, _pos) File "C:\Python27\lib\site-packages\dbfpy\fields.py", line 455, in lookupFor return _fieldsRegistry[typeCode] KeyError: '0' </code></pre> <p>And heres my simple code that is returning this error: </p> <pre><code>def getUsedGuns(self): itemdb = dbf.Dbf('item.dbf', readOnly=True, ignoreErrors=True) </code></pre> <p>Like I said, I can load other files with out a problem but maybe there is a work around for this specific error? </p> <p>EDIT: I'd also like to point out that the file can be opened and viewed and modified in DBF View Plus. </p> <p>EDIT: Solution Found. I actually ended up using the python dBase module. I think my main problem was not having the memo files around(whatever they are, it has a .fpt file extension). Heres what I am using at the moment: </p> <pre><code>from dbf.tables import VfpTable itemdb = VfpTable('item.db') for rec in itemdb: print rec['MY_COLUM_NAME'] </code></pre> <p>I'd also like to point out that anyone currently still using FoxPro should be burned. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload