GeoffDS
GeoffDS

Reputation: 1271

Is it possible to store data from Python in Access file?

Well, I might be doing some work in Python that would end up with hundreds of thousands, maybe millions of rows of data, each with entries in maybe 50 or more columns. I want a way to keep track of this data and work with it. Since I also want to learn Microsoft Access, I suggest putting the data in there. Is there any easy way to do this? I also want to learn SAS, so that would be fine too. Or, is there some other program/method I should know for such a situation?

Thanks for any help!

Upvotes: 1

Views: 413

Answers (2)

S.Lott
S.Lott

Reputation: 391872

Since I also want to learn Microsoft Access,

Don't waste your time learning Access.

I suggest putting the data in there. Is there any easy way to do this?

ODBC.

Or, is there some other program/method I should know for such a situation?

SQLite and MySQL are far, far better choices than MS-Access.

Upvotes: 0

Larry Lustig
Larry Lustig

Reputation: 50990

Yes, you can talk to any ODBC database from Python, and that should include Access. You'll want the "windows" version of Python (which includes stuff like ODBC) from ActiveState.

I'd be more worried about the "millions of rows" in Access, it can get a bit slow on retrieval if you're actually using it for relational tasks (that is, JOINing different tables together).

I'd also take a look at your 50 column tables — sometimes you need 50 columns but more often it means you haven't decomposed your data sufficiently to get it in normal form.

Finally, if you use Python to read and write an Access database I don't know if I'd count that as "learning Access". Really learning Access would be using the front end to create and maintain the database, creating forms and reports in Access (which would not be available from Python) and programming in Visual Basic for Applications (VBA).

I really like SQLite as an embedded database solution, especially from Python, and its SQL dialect is probably "purer" than Access's.

Upvotes: 1

Related Questions