469,286 Members | 2,442 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,286 developers. It's quick & easy.

mxODBC problems

I have just installed mxODBC on my x86_64 suse linux machine, where I
use unixODBC for connection. Running queries from isql or DataManager
works fine for the DSN that I am using. However, under mxODBC, I can
get a connection object and a cursor object, but all attempts to
execute even the simplest selects result in empty resultsets. Any
ideas on what might be wrong?
>>from mx.ODBC.unixODBC import *
con = connect('Postgresql',user='username',password='pas swd')
cur = con.cursor()
cur.execute('SELECT * FROM g_rif')
rs = cur.execute('SELECT * FROM g_rif')
rs
cur.execute('SELECT * FROM g_rif').fetchall()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'NoneType' object has no attribute 'fetchall'

Thanks,
Sean

Jan 9 '07 #1
1 1289
Sean Davis wrote:
I have just installed mxODBC on my x86_64 suse linux machine, where I
use unixODBC for connection. Running queries from isql or DataManager
works fine for the DSN that I am using. However, under mxODBC, I can
get a connection object and a cursor object, but all attempts to
execute even the simplest selects result in empty resultsets. Any
ideas on what might be wrong?
>>>from mx.ODBC.unixODBC import *
con = connect('Postgresql',user='username',password='pas swd')
cur = con.cursor()
cur.execute('SELECT * FROM g_rif')
rs = cur.execute('SELECT * FROM g_rif')
rs
cur.execute('SELECT * FROM g_rif').fetchall()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'NoneType' object has no attribute 'fetchall'

Thanks,
Sean
I think you will find that there result returned by the
cur.execute is None upon success. You probably meant:

cur.execute('SELECT * FROM g_rif')
table=cur.fetchall()

Then process table.

-Larry
Jan 9 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

14 posts views Thread by Jim Hubbard | last post: by
5 posts views Thread by Corky | last post: by
4 posts views Thread by BartlebyScrivener | last post: by
3 posts views Thread by Greg Corradini | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.