Question about ODBC

Paul Boddie paul at boddie.net
Wed Aug 28 05:16:03 EDT 2002


k.weinert at gmx.net (Karsten Weinert) wrote in message news:<fa576652.0208271822.1b4f0155 at posting.google.com>...
> Hi,
> I can not understand the following behavior of the Access ODBC driver 
> and/or Python. The problem is: I open a ODBC connection, do some
> SQL-statements, for example create a new table an put some data in it.
> Then I close the connection. When I open the connection again, the new
> table has disappeared!

[...]

> Can you please give me some advice how to avoid this? 

Whilst I have no direct experience with Access, I think that it could
be one of those databases which has transactional control over the
creation and deletion of tables and other schema-related things.
Moreover, any changes to data (insertions, updates or deletions)
within a transaction are going to be rolled back unless explicitly
committed, or unless autocommit mode was enabled.

My advice is to either set autocommit mode when connecting to the
database - see your ODBC module and database system documentation for
details - or to explicitly commit changes using the connection object.

Paul



More information about the Python-list mailing list