mxODBC + Win2k + SP1 + Python 1.5.2 Broke?
M.-A. Lemburg
mal at lemburg.com
Sat Aug 12 05:56:59 EDT 2000
Joe Salmeri wrote:
>
> Database is MS Access 2000.
>
> Prior to installing SP1 the following script worked:
>
> # Start of Script
> import ODBC
>
> dbs = ODBC.Windows.connect('rolo')
> sql = "select firstname & ' ' & lastname from rolo"
> c = dbs.cursor()
> c.execute(sql)
>
> while 1:
> row = c.fetchone()
> if not row: break
> print row
> #End of Script
>
> After installing SP1 in produces the following error:
>
> Traceback (innermost last):
> File "H:\b.py", line 13, in ?
> row = c.fetchone()
> MemoryError
Oh, how I like these MS SPs ... at least you don't
get a segfault ;-)
Perhaps you need to update the Access ODBC driver too ?
MS has a Platform SDK which always includes the lastest
drivers available.
> After further investigation I have found that:
>
> 1) If & appears in the select statement it fails.
> 2) If ' (single quote used for a literal) appears in the select statement
> it fails
> (ie. select 'test' from table)
>
> Changing the select statements to remove the literal references or the
> concatenation (via &) produces the correct results.
Weird.
Could you run Python in debug mode (python -d) when
executing the above lines and send me the mxODBC.log file
that this produces ?
One possible reason could be that Access2k sends back
some huge column length parameters. The log file will
show this.
Thanks,
--
Marc-Andre Lemburg
______________________________________________________________________
Business: http://www.lemburg.com/
Python Pages: http://www.lemburg.com/python/
More information about the Python-list
mailing list