0

I have a little script that converts dbf files into mysql and uploads them to the database. It all works fine on one machine but not another. I get a NotImplementedError.

code snippet im having issues with:

from dbf import dbf

db = dbf.Dbf("test.dbf")
for i in db:
    print i["One"]
    print i["Two"]

traceback:

Traceback (most recent call last):
  File "test.py", line 4, in <module>
    for i in db:
  File "C:\Users\Admin1\Desktop\python\virtual\dbfpy\dbf.py", line 242, in __get
item__
    return self.RecordClass.fromStream(self, self._fixIndex(index))
  File "C:\Users\Admin1\Desktop\python\virtual\dbfpy\record.py", line 121, in fr
omStream
    return cls.fromString(dbf, cls.rawFromStream(dbf, index), index)
  File "C:\Users\Admin1\Desktop\python\virtual\dbfpy\record.py", line 140, in fr
omString
    [_fd.decodeFromRecord(string) for _fd in dbf.header.fields])
  File "C:\Users\Admin1\Desktop\python\virtual\dbfpy\fields.py", line 173, in de
codeFromRecord
    return self.decodeValue(self.rawFromRecord(record))
  File "C:\Users\Admin1\Desktop\python\virtual\dbfpy\fields.py", line 342, in de
codeValue
    raise NotImplementedError
NotImplementedError
user3972986
  • 490
  • 1
  • 5
  • 14

1 Answers1

-1

I once had a similar problem with a project I was working on.

It turned out that it was because of an incorrect type being set in a memo field that I'd added to my table.

Once I corrected the fields type, everything was ok, the following stack overflow post helped me.

Python dbfpy and FoxPro

Community
  • 1
  • 1
Nanu
  • 1