If you know this well enough:
Python, it's database modules, and ODBC configuration
then you should know how to do this:
open a database, read some data, insert it in to a different database
如果是这样,那么你就非常接近你所需要的解决方案了。诀窍是,你可以将MDB文件作为ODBC数据源打开。 现在。我不确定你是否可以用ODBC在MDB文件中 "创建表格",所以让我提出这个秘诀。
Create an MDB file with name "TARGET.MDB" -- with the necessary tables, forms, reports, etc. (Put some dummy data in and test that it is what the customer would want.)
Set up an ODBC datasource to the file "TARGET.MDB". Test to make sure you can read/write.
Remove all the dummy data -- but leave the table defs intact. Rename the file "TEMPLATE.MDB".
When you need to generate a new MDB file: with Python
copy
TEMPLATE.MDB to TARGET.MDB.
Open the datasource to write to TARGET.MDB. Create/copy required records.
Close the datasource, rename TARGET.MDB to TODAYS_REPORT.MDB... or whatever makes sense for this particular data export.
这对你有好处吗?
几乎可以肯定的是,在Windows上做这些事情会更容易,因为对ODBC的支持将是最广泛可用的。 然而,我认为原则上你可以在Linux上这样做,只要你找到合适的ODBC组件,通过ODBC访问MDB。