On Tuesday, August 30, 2011 03:07:13 pm Roger Gammans wrote: > On Tue, 2011-08-30 at 14:08 -0700, John Fabiani wrote: > > Hi, > > I have a little time available and I thought I would look into using > > pyodbc with Dabo. > > John, If I haven't mentioned it before it might be worth you looking at > http://hg.backslashat.org/repos/dabo-odbc/ which is contains > a set of patchs to an ancient dabo to do this. > > > The first issue is the connection string. The pyodbc does NOT > > > > follow the "host", "user", etc. that we have been using for the > > connection. For example to connect to an MS SQL database on windows you > > would use something like: > > DRIVER={SQL Server};SERVER=cloak;DATABASE=test;UID=user;PWD=password > > > > > > And of course the connection string would be different for other > > platforms and database engines. At first I thought I would just change > > CxnEditor to deal > > That's what I did locally and added a driver and dsn attribute. It was > good enough for what I needed so I haven't mantained it. But it would > probably help you in the right direction. > > The important patches are :- > http://hg.backslashat.org/repos/dabo-odbc/rev/af94151ed49a > http://hg.backslashat.org/repos/dabo-odbc/graph/aeb4a75ba49f > > and > http://hg.backslashat.org/repos/dabo-odbc/rev/eb192fd4cd54 > > But you could just the db/dbOdbc.py from the last one and hack from > there.
Roger, thanks for the code - I'm sure I'll use it in the near future (I've actually haven't started yet). After reading some of the code I do have a few questions! Why did you find it necessary to create the "Cursor" class? It appears the pyodbc has pyodbc.Cursor class. Did you find it did not match the Dabo requirements - I ran into this with the old pymssql and was unable to get it to work - Ed finished the job. You did not use "INFORMATION_SCHEMA" to access table, field information. I was planned on using the INFORMATION_SCHEMA as a universal way of accessing the system info. Of course I'm under the impression that all the major database engines have it available. Last the code implies that you were ONLY connecting to MSSQL - is that correct? Did you try connecting to other database engines? Johnf _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev Searchable Archives: http://leafe.com/archives/search/dabo-dev This message: http://leafe.com/archives/byMID/[email protected]
