On Nov 29, 2012, at 2:16 PM, E.Scott M. wrote:
>
> On Thursday, November 29, 2012 12:53:43 PM UTC-6, Michael Bayer wrote:
>
> On Nov 29, 2012, at 1:25 PM, E.Scott M. wrote:
>
>> I am migrating my accounting from Microsoft Dynamics(Mssql) to Quickbooks
>> Enterprise. I have had lots of custom code written to bridge between my
>> website and Dynamics. I am trying to port that code over to quickbooks but I
>> am having a very difficult time.
>> We used sqlAlchemy and python to create out custom code. I am trying to use
>> sqlalchemy for the quickbooks port.
>> I am using QODBC on the quickbooks side and mxODBC on the python side.
>> I can use mxODBC native functions and direct connect to the quickbooks
>> database - access the tables and data, but the mxodbc.directconnect()
>> function will not work syntactically with sqlalchemy connection strings.
>>
>> In sqlalchemy this is what I can do:
>>
>> engine = create_engine('mssql+mxodbc://@QRQBwhoimp')
>> >>> metadata = MetaData('mssql+mxodbc://@QRQBwhoimp')
>> >>> metadata.bind = engine
>> >>> connection = engine.connect()
>>
>> I dont receive any error messages until I try and connect - then I get:
>> sqlalchemy.exc.NotSupportedError: (NotSupportedError) ('IM001', 0,
>> '[Microsoft][ODBC Driver Manager] Driver does not sup
>> port this function', 12173) None None
>>
>> Also, if I try to reflect a table, I get the same error message. I have
>> tried a lot of different connection strings and this one seems to work
>> without error messages that other ones generate.
>
> Make sure you're on the very latest released version of mxodbc, and possibly
> also try pyodbc. The error is being emitted from your ODBC driver but I'm
> not familiar with its meaning.
>
> Thank you Michael,
> I have the brand new eval version of Mxodbc because qbodbc has some kind of
> bug with pyodbc.
> Qodbc tech support has added it to their bug list but I have no idea when it
> may be fixed.
> Preliminary tests with mxodbc seemed promising as I can use their connect
> function and get access to the database which is more than I could do with
> pyodbc, but now I am having this problem with sqlAlchemy.
> Is there any way to get around the connection string?
> For example this works using mxodbc.
> Example:
> > qdb = mx.ODBC.Windows.DriverConnect('DSN=QRQBwhoimp')
> That gives me a connection I can declare a cursor on and get data in and out.
there have been fixes and improvements to the mxodbc driver in 0.8, so you can
try that, however there hasn't been a problem with connecting.
We connect like this:
from mx.ODBC import Windows
conn = Windows.connect('QRQBwhoimp', user='', password='')
I dont know what the "DriverConnect" function is. I've developed and
recently improved the mxodbc driver through direct collaboration with mxodbc's
author.
You might want to enable "echo=True" on create_engine() to determine exactly
what "function" is not supported, it may be attempting to execute a statement
the driver doesn't like.
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en.