I am 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.
Traceback (most recent call last):
File "billsapi.py", line 250, in <module>
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'
And heres my simple code that is returning this error:
def getUsedGuns(self):
itemdb = dbf.Dbf('item.dbf', readOnly=True, ignoreErrors=True)
Like I said, I can load other files with out a problem but maybe there is a work around for this specific error?
EDIT: I'd also like to point out that the file can be opened and viewed and modified in DBF View Plus.