Vernon Cole wrote:
I've just had a success story with the adodbapi now included in build 211,
and thought it would be a good idea to let everyone know how to do it.
My application ran a very gnarly SQL script against master..sysprocesses
to
identify blocked SQL requests. It tended to crash python when the MSSQL
server was running badly, which was, of course, when I needed it most. It
happened again today.
I replaced:
import dbi, odbc
conn = odbc.odbc("Oasis Data/oareport/xxxxx")
with:
import adodbapi
conn = adodbapi.connect("DSN=Oasis Data; Uid=oareport; Pwd=xxxxx")
and presto! the script runs with no errors and no other changes.
<http://www.connectionstrings.com>
A working example of creating and connecting to a Microsoft Access type
(a.k.a. "jet") database can be found in
Lib/site-packages/adodbapi/tests/adodbapitestconfig.py. There are also
MSSQL, mysql, and AS400 examples in that file.
Connection string examples for many other situations can be found at
www.connectionstrings.com
--
Vernon Cole
Tim Golden is starting a collection of snippets and examples here:
http://timgolden.me.uk/python-on-windows/
You might want to ask if he could add a section for
database operations.
Roger
_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32