0

I have a .db file created with SQLite3. I want to use anydbm to read this file.

My code:

import anydbm
db = anydbm.open('mydb.db', 'r')

However, it throws this error --> "anydbm.error: db type could not be determined"

I don't get it. What is wrong with this? The file type according to the Unix file command is SQLite 3.x.

Does anybody know what's causing this? Also, is there a better library for reading .db files?

Thanks

1 Answer 1

4

Anydbm module is only for db/dbm/gdbm type of files. It does not work at all with sqlite. They are not the same thing, and don't have the same file format. Use the sqlite module for SQLite databases.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.