468,785 Members | 1,730 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,785 developers. It's quick & easy.

[help] how to generate a empty ".MDB" file using python

Hi all:
I working in MS window environment. Now I want to use a python
script to import some data from CSV file to MDB file.
but I have some problems about creating MDB file in DAO.

I am using attached code , but the last line seems invalid.
Does anyone could help me. Thanks!

import win32com.client
eng=win32com.client.Dispatch("DAO.DBEngine.36")
eng.CreateDatabase("d:\\temp.mdb")

Regards
Denton
Jan 15 '06 #1
1 2586
"Denton" <De****@anonymous.com> wrote in message news:86********************************@4ax.com...
Hi all:
I working in MS window environment. Now I want to use a python
script to import some data from CSV file to MDB file.
but I have some problems about creating MDB file in DAO.

I am using attached code , but the last line seems invalid.
Does anyone could help me. Thanks!

import win32com.client
eng=win32com.client.Dispatch("DAO.DBEngine.36")
eng.CreateDatabase("d:\\temp.mdb")

Regards
Denton


It's helpful if you post the traceback. I get
com_error: (-2147352567, 'Exception occurred.', (0, 'DAO.DbEngine', 'Invalid argument.', 'jeterr40.chm', 5003001, -2146825287),
None)

Apparently the Locale parameter is required.
eng=win32com.client.gencache.EnsureDispatch("DAO.D BEngine.36")
eng.CreateDatabase("d:\\temp.mdb", win32com.client.constants.dbLangGeneral)

hth
Roger

----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Jan 15 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by python-help-bounces | last post: by
14 posts views Thread by Jeffery Tyree | last post: by
1 post views Thread by Tim Marshall | last post: by
10 posts views Thread by Atley | last post: by
2 posts views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.