Using Python to access Progress DB

Cecil

19+ years progress programming and still learning.
So I did my quick five minute lightning talk, and somebody has ask me to do the same mini presentation at a Python meetup. I joined the Python meetup group and went to my first session tonight just to get a feel for the target audience.

So I have one month to create some quick and dirty 'Python' code which will connect to an Openedge database (most likely sports2000) via JDBC or ODBC. Then do a few simple queries exporting the results to the screen or if I'm feeling confident even a dynamically generated webpage.

I found a KB article about which Python modules are required but I'm going to need a bit more help. Has anybody used Python to connect to the openedge database?
 

Cringer

ProgressTalk.com Moderator
Staff member
Just splitting this out as it's a different request and is more of a question for help than chit chat. Hope that's ok :)
 

Cecil

19+ years progress programming and still learning.
What exactly are you looking for? Accessing a Progress DB through ODBC is pretty much the same as accessing any other ODBC database.

http://www.easysoft.com/developer/languages/python/pyodbc.html

It did not take me long to get something working. My first ever Python code and a successful ODBC connection. I guess I've answered my own question. Now i've even got more time up my sleeve to do something very cool now, but what?

Code:
import pyodbc

cnxn = pyodbc.connect('DRIVER={Progress OpenEdge 11.4 Driver};HostName=flow;DATABASENAME=report;PORTNUMBER=4556;LogonID=sysprogress;PASSWORD=progress')
cursor = cnxn.cursor()
cursor.execute("select Username from PUB.Client")
rows = cursor.fetchall()
for row in rows:
    print(row.Username)
 

Rob Fitzpatrick

ProgressTalk.com Sponsor
Can you even access the VST hidden fields via ODBC?
Yes! I just created a DSN for one of my dev databases, connected to the SQL broker via Excel, selected "show system tables", and ran a SELECT from _TableStat. It returned a result set. Give it a try.
 

Cecil

19+ years progress programming and still learning.
Just splitting this out as it's a different request and is more of a question for help than chit chat. Hope that's ok :)
OK. But I think there was a bit of a timing issues. Some other posts need to be brought over as-well.
 
Top