On Wednesday 13 September 2006 21:52, Glenn Davy wrote:
> does anyone know off hand, or from personal experience what the
> limitations of a FreeDTS solution are in terms of dealing with mssql2000
> and/or 2005? (this seems to be FreeDTS based) I seem to remember Ed
> mentioned he started down this track, but had to abort due to time
> constraints.
>
> on native windows you can lever sqldmo and oledb,adodb and all that
> other msdac stuff inside python, but till they release it natively for
> *ix (insert refs to pigs flying, hell freezing over etc) - I think the
> legacy of its sybase origins (using FreeDTS) is all there is - so that
> sets a ceiling on what can be done - anyone know what that ceiling is?
>
> glenn
I have setup access to MsSQL using SUSE 10.0, unixODBC, freeTDS.  I have used 
very complex select statements without issue using python.  But make sure you 
are using the latest version for everything.  I read an old post where there 
was some issue with a older version.  I haven't tried accessing or writing a 
text/blob field yet. 

Currently I have used cherrypy web server to pass the data - see example code 
below.  

 I have been thinking it might be possible to use isql (Linux) and osql 
(windows) to pass statements.  On the surface it looks possible to have one 
base of code to access MsSQL from Linux and windows.  I have no idea about 
MAC's.

import cherrypy 
import mx.ODBC.unixODBC

         
        # Note: only recent versions of CherryPy take "thread_index". For older 
versions, 
        # you might have to do: 
        # def connect(): 
def connect(thread_index): 
            # Create a connection and store it in the current thread 
        cherrypy.thread_data.db = 
mx.ODBC.unixODBC.DriverConnect('DSN=mssql;UID=vamlogin;PWD=go') 
         
        # Tell CherryPy to call "connect" for each thread, when it starts up 
cherrypy.server.on_start_thread_list.append(connect) 

         
class Root:
            def doLogin(self, username=None, password=None): 
                # check the username & password 
                cur = cherrypy.thread_data.db.cursor()
                cur.execute('select ccustno from arcust where ccustno = 
?',(username,))
                row = cur.fetchone()
                cur.close

John

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users

Reply via email to