Menu

Specify another Freetds configuration

Franck
2009-04-21
2013-04-29
  • Franck

    Franck - 2009-04-21

    Hello
    My installation of FreeTDS is not in the common directory
    How you i specify it to PYMSSQL

     
    • A

      A - 2009-04-21

      You can use the environment variables.
      http://www.freetds.org/userguide/envvar.htm

       
    • Franck

      Franck - 2009-04-22

      Andrzej,

      The environment variable works for a bash execution not a python....

      import _mssql
      conn = _mssql.connect('MSSQL','x', 'xx')
      cur = conn.cursor()

      cur.execute('SELECT * FROM xxxxx')
      row = cur.fetchone()
      while row:
          print "ID=%d, Name=%s" % (row[0], row[1])
          row = cur.fetchone()

      conn.close()

      where should i put them....

       
      • A

        A - 2009-04-22

        > where should i put them....
        put an 'export' (sh/bash) or 'setenv' (csh) statement just before calling Python...

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.