473,440 Members | 1,803 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,440 software developers and data experts.

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 1423
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Jim Hubbard | last post by:
Are you up to speed on the difficulties in using the 1.1 .Net framework? Not if you are unaware of the 1,596 issues listed at KBAlertz (http://www.kbalertz.com/technology_3.aspx). If you are...
1
by: 3f | last post by:
Hello; We have made a web application that people can download from our web site and installed on: Windows XP Windows 2000 Professional Windows 2003 Server Windows 2000 Server
5
by: Corky | last post by:
This works: db2 SELECT DISTINCT PROBLEM_OBJECTS.PROBLEM_ID FROM PROBLEM_OBJECTS INNER JOIN PROBLEMS ON PROBLEM_OBJECTS.PROBLEM_ID = PROBLEMS.PROBLEM_ID WHERE INTEGER(DAYS(CURRENT DATE) -...
10
by: BBFrost | last post by:
We just recently moved one of our major c# apps from VS Net 2002 to VS Net 2003. At first things were looking ok, now problems are starting to appear. So far ... (1) ...
4
by: BartlebyScrivener | last post by:
Hello, I'm new to python and trying to get records from an MSAccess database using mxODBC. It works, but the output is not formatted the way I want it. Here's the script: import...
3
by: Greg Corradini | last post by:
Hello, I'm trying to perform a simple insert statement into a table called Parcel_Test (see code below). Yet, I get an error message that I've never seen before (see traceback below). I've tried...
0
bartonc
by: bartonc | last post by:
This is a work in progress (current and active). There are some issues to resolve in supporting multiple connection types and I plan to add PySQLite to the mix. The this update is due to my...
0
by: Terry Reedy | last post by:
FYI I initially parsed the subject line as "eGenix mxODBC - ODBC Database Interface" for "Python 3.0.2" and thought, "Wow, already prepared for the future" (6 months to a year) ;-). tjr
0
by: eGenix Team: M.-A. Lemburg | last post by:
On 2008-10-15 20:30, Terry Reedy wrote: It's going to look even better when we release version 4.0 in a year or so ;-) FWIW, we're still waiting for the dust to settle before going for a Py3k...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.