ODBC Select

L

Larry

I am trying to connect to my MySQL database using python and ODBC.

Here is what I am doing.

Notice I get the "0" after the select statement.
Problem is, there are 20 records in the database. In fact I can do this

and then I can do this

but when I do

Anyone seen this and can maybe tell me why this is occuring. I have
full privileges as I can log on and query with the DSN from other programs.

Thanks,
Larry
 
S

Stephen Prinster

Larry said:
I am trying to connect to my MySQL database using python and ODBC.

Here is what I am doing.


Notice I get the "0" after the select statement.
Problem is, there are 20 records in the database. In fact I can do this


and then I can do this


but when I do


Anyone seen this and can maybe tell me why this is occuring. I have
full privileges as I can log on and query with the DSN from other programs.

Thanks,
Larry
According to PEP 249, the return value for cursor.execute() is undefined
and there seems to be little documentation for the ODBC module, so my
guess (and I can't confirm it from home where I have no Windows) is that
0 indicates "success" and has nothing to do with the number of
records. Have you tried a "print cursor.fetchone()" to see if anything
is there?
 
L

Larry

According to PEP 249, the return value for cursor.execute() is undefined
and there seems to be little documentation for the ODBC module, so my
guess (and I can't confirm it from home where I have no Windows) is that
0 indicates "success" and has nothing to do with the number of
records. Have you tried a "print cursor.fetchone()" to see if anything
is there?

Wow!
I feel silly!
Just as you said.
The records are there.
Thanks!

Larry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top