On Dec 19, 2012, at 5:10 PM, ScottyMac wrote: > > On Wednesday, December 19, 2012 3:37:16 PM UTC-6, Michael Bayer wrote: > > On Dec 19, 2012, at 2:49 PM, ScottyMac wrote: > >> I have no problem at all with pyodbc and qodbc >> Here is a sample I just did: >> I include a call to connect without autocommit - which throws an error, and >> then the one what works. >> The error message is exactly the same one I get trying to connect SQLAlchemy. >> >> I do not know how to translate cx = pyodbc.connect('DSN=Quickbooks', >> autocommit=True) >> into an equivalent connection string for SQLAlchemy. >> >> >>> cx = pyodbc.connect('DSN=Quickbooks') >> Traceback (most recent call last): >> File "<stdin>", line 1, in <module> >> pyodbc.Error: ('IM001', '[IM001] [QODBC] Driver not capable (11010) >> (SQLSetConnn >> ectAttr(SQL_ATTR_AUTOCOMMIT))') >> >>> cx = pyodbc.connect('DSN=Quickbooks', autocommit=True) >> >>> cursor = cx.cursor() >> >>> cursor.execute("select * from vendor") >> <pyodbc.Cursor object at 0x03237FA8> >> >>> cursor.fetchone() >> ('8000056F-1349473233', datetime.datetime(2012, 10, 5, 16, 40, 33), >> datetime.dat >> etime(2012, 11, 23, 10, 37, 18), '1353688638', '7 Accessories **06-08-10**', >> Tru > > as I said, adding it to create_engine: > > from sqlalchemy import create_engine > > engine = create_engine('mssql+pyodbc://ADMIN@Quickbooks', > connect_args={"autocommit":True}) > > >> I suppose I am thick(stupid). >> Having just told me in a previous post not to use mssql+ unless my database >> was really MSSQl, I did not include that - and it gives me a module not >> found error. >> HOWEVER: >> If I use exactly the string you have listed above, my autocommit error goes >> away, replaced by another error:
yeah that's where the MSSQL dialect is doing things that aren't going to work with QODBC. I don't have a quick fix for this for you, it would require creating a new dialect that doesn't perform these particular startup queries. unless you want to get into doing a little bit of programming, you might have to work directly with pyodbc for now. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.