python读取mdb_什么可以从Python读取Microsoft .MDB文件?

I''m looking for something that can read .MDB files, the format

Microsoft Access uses, from Python. I need to do this on

Linux, without using Microsoft tools. I just need to read

the files once, so I can load the tables into another database.

Speed isn''t an issue, and I don''t need to access the file in

database fashion. The files are too big to read into RAM all at once,

though.

I tried "MDBtools", but the only (last) release was

a pre-release three years ago, and I''ve encountered

many build problems trying to make it work on Fedora

Core 6.

John Nagle

解决方案John Nagle schrieb:

I''m looking for something that can read .MDB files, the format

Microsoft Access uses, from Python. I need to do this on

Linux, without using Microsoft tools. I just need to read

the files once, so I can load the tables into another database.

Speed isn''t an issue, and I don''t need to access the file in

database fashion. The files are too big to read into RAM all at once,

though.

I tried "MDBtools", but the only (last) release was

a pre-release three years ago, and I''ve encountered

many build problems trying to make it work on Fedora

Core 6.

I was just gonna suggest it. Under ubuntu, it works easy as cake, and

converts the mdb nicely to some CSV-files.

I think you should really try and make it work.

Diez

Diez B. Roggisch wrote:

John Nagle schrieb:

> I''m looking for something that can read .MDB files, the format

Microsoft Access uses, from Python. I need to do this on

Linux, without using Microsoft tools. I just need to read

the files once, so I can load the tables into another database.

Speed isn''t an issue, and I don''t need to access the file in

database fashion. The files are too big to read into RAM all at once,

though.

I tried "MDBtools", but the only (last) release was

a pre-release three years ago, and I''ve encountered

many build problems trying to make it work on Fedora

Core 6.

I was just gonna suggest it. Under ubuntu, it works easy as cake, and

converts the mdb nicely to some CSV-files.

I think you should really try and make it work.

Diez

What MDBtools did you install? The RPM, a checkout from CVS,

or the downloadable distribution? They''re all different.

John Nagle

On Mar 19, 2:45 pm, John Nagle

Diez B. Roggisch wrote:

John Nagle schrieb: I''m looking for something that can read .MDB files, the format

Microsoft Access uses, from Python. I need to do this on

Linux, without using Microsoft tools. I just need to read

the files once, so I can load the tables into another database.

Speed isn''t an issue, and I don''t need to access the file in

database fashion. The files are too big to read into RAM all at once,

though. I tried "MDBtools", but the only (last) release was

a pre-release three years ago, and I''ve encountered

many build problems trying to make it work on Fedora

Core 6. I was just gonna suggest it. Under ubuntu, it works easy as cake, and

converts the mdb nicely to some CSV-files. I think you should really try and make it work. Diez

What MDBtools did you install? The RPM, a checkout from CVS,

or the downloadable distribution? They''re all different.

John Nagle

I''ve read .MDB files using ODBC. I don''t know how big your files are,

but I had a file with almost 3000 rows and I was able to fetch it in

1-2 seconds. If you want to give it whirl, you just need to create an

ODBC connection and then do the following:

myconn = odbc.odbc(''mydb_connection_name'')

mycursor = myconn.cursor()

mycursor.execute(''SELECT * FROM db_name'')

mydata = mycursor.fetchall()

mycursor.close()

myconn.close()

for each in mydata:

# do something like pull the info from the variable "mydata" and

send it into the other database

It is fast. But you may like what the others have said more.

Mike

你可能感兴趣的:(python读取mdb)