cursor.execute fails under mxODBC
Louis Luangkesorn
lluang at northwestern.edu
Thu Mar 8 16:52:14 EST 2001
I have the same problem. Below is my output. I will first use the odbc
that comes included with ActivePython, then the mxODBC module (by the way,
I've tried to rename the odbc.pyc file, that did not help, except break
odbc)
PythonWin 2.0 (#8, Oct 19 2000, 11:30:05) [MSC 32 bit (Intel)] on win32.
Portions Copyright 1994-2000 Mark Hammond (MarkH at ActiveState.com) - see
'Help/About PythonWin' for further copyright information.
>>>
>>> import dbi,odbc
>>> import pprint
>>> channel = odbc.odbc('sqltutor')
>>> ch1 = channel.cursor()
>>> ch1.execute('SELECT FirstName, LastName, Address, City, State FROM
EmployeeAddressTable')
0
>>> test1 = ch1.fetchall()
>>> pprint.pprint(test1)
[('Joe', 'Smith', '83 First Street', 'Howard', 'Ohio'),
('Mary', 'Scott ', '842 Vine Ave.', 'Losantiville', 'Ohio '),
('Sam', 'Jones ', '33 Elm St.', 'Paris', 'New York '),
('Sarah', 'Ackerman ', '440 U.S. 110', 'Upton', 'Michigan ')]
>>> ch1.close()
>>> channel.close()
>>> import mx.ODBC
>>> channel = mx.ODBC.Windows.connect('sqltutor')
>>> ch1 = channel.cursor()
>>> ch1.execute('SELECT FirstName, LastName, Address, City, State FROM
EmployeeAddressTable')
at this point the whole thing dies. No error messages. I didn't see any
log files anywhere either.
Louis
--
K Louis Luangkesorn
lluang at northwestern.edu http://pubweb.nwu.edu/~kll560 PGP:0xF3E2D362
Whatsoever things are true, ... honest, ... just, ... pure, ... lovely, ...
of good report; if there be any virtue, and if there be any praise, think on
these things.- motto - Northwestern University
More information about the Python-list
mailing list