Hi,
I asked about this yesterday. I was told there wasn't even a log of my
attempts on the server, so I wasn't reaching it for some reason. Yes,
my IP was right--I wish it were that easy. :)
Now, here's where it gets extremely weird. Using straight pyodbc, I
can connect to the server and run queries all I want. The moment I use
ibm_db_sa, I get the dreaded "pyodbc.Connection object has no
attribute dbms_ver". If I remove "+pyodbc" from my connection string,
it doesn't work, but at least I don't get that error.
I know you guys have said before that ibm_db isn't well supported with
pyodbc, but I'm told on the sqlalchemy list that this is the only way
I can use the proper dialect with SA. More importantly, pyodbc is, so
far, the only package that successfully connects me to the server at
all. I believe this is because I can specify the driver to pyodbc,
whereas I can't do that in SA.
Right now, my connection in SA looks like this:
def iSeriesConnector():
conn = pyodbc.connect(driver=driver, system=server, uid=username, pwd=password)
return conn
#end def iSeriesConnector
dbEngine = create_engine("db2+pyodbc://", creator=iSeriesConnector)
#works, or at least doesn't throw
print "connecting" #prints
dbEngine.connect() #throws the AttributeError exception
print "connected" #never reached
I'm at a total loss. I guess I could use pyodbc exclusively in my app,
but I'd rather not. I'm also confused about why ibm_db itself won't
work, where pyodbc will. What am I doing wrong? The credentials are
the same, as is the IP, for both. The only differences are that pyodbc
lets me give it a driver name, and it doesn't ask for a port number.
As before, I have the latest everything to the best of my knowledge.
Python 2.7 x 64 on Windows 7.