I guess that's a symptom of the ibm_db_sa package not being very well tested with pyodbc
I'm very confused by pyodbc's version numbers - https://pypi.python.org/pypi/pyodbc/3.0.10 suggests that version 3.0.10 exists and was uploaded on 2015-04-29, but also says that the latest version is 2.1.9, which was uploaded on 2015-09-24. I've never used pyodbc so don't know what to make of that. I assume your error is coming from this line: https://github.com/ibmdb/python-ibmdbsa/blob/master/ibm_db_sa/ibm_db_sa/base.py#L696 ...which is in the base dialect, rather than the pyodbc-specific bit. Maybe you could hack around the problem by setting a "dbms_ver" attribute on the pyodbc connection that you are creating in your custom creator function. This is where it gets used: https://github.com/ibmdb/python-ibmdbsa/blob/master/ibm_db_sa/ibm_db_sa/base.py#L481 Simon On Fri, Feb 19, 2016 at 5:00 PM, Alex Hall <ah...@autodist.com> wrote: > That makes more sense, but as soon as I put "+pyodbc" in, I'm back to > last week's "pyodbc.Connection object has no attribute dbms_ver" > error. Pyodbc seems to be the problem, which is ironic--on its own, > pyodbc is the only way I've been able to talk to the server at all. > Add it to SA, though, and that attribute error appears. > > On 2/19/16, Simon King <si...@simonking.org.uk> wrote: > > According to > > > http://docs.sqlalchemy.org/en/rel_1_0/core/connections.html#registering-new-dialects > , > > a dialect registered as "db2.pyodbc" should be specified in the URL as > > "db2+pyodbc://". Does that make any difference? > > > > On Fri, Feb 19, 2016 at 4:20 PM, Alex Hall <ah...@autodist.com> wrote: > > > >> Thanks. I tried both, and triedother variations including or excluding > >> the module name as a prefix (ibm_db_sa.db2.pyodbc://). In most cases, > >> I get: > >> sqlalchemy.exc.ArgumentError: could not parse RFC1738 URL from string > >> [my connection string]". > >> > >> If I don't get that, it's because I used a name that complains about > >> there being no attribute dbms_ver or server.version, depending on the > >> string. > >> > >> They don't make it easy, do they? > >> > >> On 2/19/16, Simon King <si...@simonking.org.uk> wrote: > >> > URI prefixes are defined in the setup.py for the ibm_db_sa package: > >> > > >> > > https://github.com/ibmdb/python-ibmdbsa/blob/master/ibm_db_sa/setup.py > >> > > >> > I would guess that you want to end up with the DB2Dialect_pyodbc > class, > >> > which means you should use db2.pyodbc:// or ibm_db_sa.pyodbc:// > >> > > >> > Simon > >> > > >> > > >> > On Fri, Feb 19, 2016 at 3:33 PM, Alex Hall <ah...@autodist.com> > wrote: > >> > > >> >> Thanks, that looks like what I'm looking for. I assume specifying > >> >> "ibm_db_sa://" for the string will let SA use the proper dialect? > >> >> > >> >> I'm now getting "pyodbc.Connection object has no attribute > >> >> server_info", in case anyone happens to know what that's about. I'm > >> >> getting nightmarish flashbacks to my "has no attribute" error last > >> >> week for the same object. But at least this is a different one; I'll > >> >> count it as a good thing! > >> >> > >> >> On 2/19/16, Simon King <si...@simonking.org.uk> wrote: > >> >> > On Fri, Feb 19, 2016 at 2:38 PM, Alex Hall <ah...@autodist.com> > >> wrote: > >> >> > > >> >> >> As the subject says, I am connected to our iSeries through > straight > >> >> >> pyodbc. That seems to run perfectly. Now, is there a way to use SA > >> >> >> with that connection? When I use "ibm_db_sa+pyodbc://..." I get > the > >> >> >> exact same error I was getting when using ibm_db directly. Using > >> >> >> pyodbc, I can specify the driver to be used, and I'm pretty sure > >> >> >> that's the key. > >> >> >> > >> >> >> Can I either use my pyodbc connection with SA and ibm_db_sa for > the > >> >> >> dialect, or specify the driver to SA directly? Thanks! > >> >> >> > >> >> >> > >> >> > You can pass a "creator" argument to create_engine if you want to > >> >> > create > >> >> > the connection yourself: > >> >> > > >> >> > > >> >> > >> > http://docs.sqlalchemy.org/en/rel_1_0/core/engines.html#custom-dbapi-connect-arguments > >> >> > > >> >> > > >> >> > >> > http://docs.sqlalchemy.org/en/rel_1_0/core/engines.html#sqlalchemy.create_engine.params.creator > >> >> > > >> >> > Hope that helps, > >> >> > > >> >> > Simon > >> >> > > >> >> > -- > >> >> > You received this message because you are subscribed to the Google > >> >> > Groups > >> >> > "sqlalchemy" group. > >> >> > To unsubscribe from this group and stop receiving emails from it, > >> >> > send > >> >> > an > >> >> > email to sqlalchemy+unsubscr...@googlegroups.com. > >> >> > To post to this group, send email to sqlalchemy@googlegroups.com. > >> >> > Visit this group at https://groups.google.com/group/sqlalchemy. > >> >> > For more options, visit https://groups.google.com/d/optout. > >> >> > > >> >> > >> >> -- > >> >> You received this message because you are subscribed to the Google > >> Groups > >> >> "sqlalchemy" group. > >> >> To unsubscribe from this group and stop receiving emails from it, > send > >> an > >> >> email to sqlalchemy+unsubscr...@googlegroups.com. > >> >> To post to this group, send email to sqlalchemy@googlegroups.com. > >> >> Visit this group at https://groups.google.com/group/sqlalchemy. > >> >> For more options, visit https://groups.google.com/d/optout. > >> >> > >> > > >> > -- > >> > You received this message because you are subscribed to the Google > >> > Groups > >> > "sqlalchemy" group. > >> > To unsubscribe from this group and stop receiving emails from it, send > >> > an > >> > email to sqlalchemy+unsubscr...@googlegroups.com. > >> > To post to this group, send email to sqlalchemy@googlegroups.com. > >> > Visit this group at https://groups.google.com/group/sqlalchemy. > >> > For more options, visit https://groups.google.com/d/optout. > >> > > >> > >> -- > >> You received this message because you are subscribed to the Google > Groups > >> "sqlalchemy" group. > >> To unsubscribe from this group and stop receiving emails from it, send > an > >> email to sqlalchemy+unsubscr...@googlegroups.com. > >> To post to this group, send email to sqlalchemy@googlegroups.com. > >> Visit this group at https://groups.google.com/group/sqlalchemy. > >> For more options, visit https://groups.google.com/d/optout. > >> > > > > -- > > You received this message because you are subscribed to the Google Groups > > "sqlalchemy" group. > > To unsubscribe from this group and stop receiving emails from it, send an > > email to sqlalchemy+unsubscr...@googlegroups.com. > > To post to this group, send email to sqlalchemy@googlegroups.com. > > Visit this group at https://groups.google.com/group/sqlalchemy. > > For more options, visit https://groups.google.com/d/optout. > > > > -- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sqlalchemy+unsubscr...@googlegroups.com. > To post to this group, send email to sqlalchemy@googlegroups.com. > Visit this group at https://groups.google.com/group/sqlalchemy. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at https://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.