|
Rich : DATABASE
This page last changed on Dec 15, 2010 by rich.
Add py database stuff 12-Dec-2010 Need something to talk python to mssql from osx. see: http://wiki.python.org/moin/SQL%20Server also see: http://meantheory.wordpress.com/2009/10/01/mssql-freetds-pyodbc-snow-leopard INSTALL pyodbc
INSTALL freetds:
Test freetds: 1) sudo /usr/bin/lipo -info /usr/local/freetds/lib/libtdsodbc.so 2) /usr/bin/iodbctest "Driver=/usr/local/freetds/lib/libtdsodbc.so;Server=134.89.12.29;Port=1433;TDS_Version=8.0;UID=expddba;pwd=******;"
import pyodbc Note the code above does not require using an ODBC DSN such as you might create with the the iODBC.app.... Though that can be done, but the iODBC.app downloaded from and install it from xcode doesnt work... complains about wrong architecure when trying to test the connection But you can manually create/use the 3 config files that define the DNS that iODBC.app uses. see: http://lists.ibiblio.org/pipermail/freetds/2009q2/024684.html The connection string becomes: cn = "Driver=%s;DSN=expd_ftds;TDS_Version=8.0;UID=%s;pwd=%s;" % ( driver,uid,pwd)
Below are extracts from the three files that will create the "DSN=expd_ftd" used above.: Ignore the "Actual" drivers, those were install from ActualTechnologies for my RealBasic ODBC projects..... **IN** /usr/local/freetds/etc/freetds.conf [expd_ftds] If it exists: **IN** /opt/local/etc/freetds/freetds.conf [expd_ftds] **IN** /Library/ODBC/odbcinst.ini [ODBC Drivers] [Actual SQL Server] [Actual Open Source Databases] [Actual Oracle] [Actual Access] [FreeTDS] [ODBC Connection Pooling] **IN** /Library/ODBC/odbc.ini [equinox] [solstice] [expd_ftds] |
| Document generated by Confluence on Feb 04, 2026 08:50 |