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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值