Rails - MS-SQL Server problems (unixODBC, FreeTDS) on Mac 10.6

Posted by TMB on Stack Overflow See other posts from Stack Overflow or by TMB
Published on 2010-05-25T05:31:26Z Indexed on 2010/05/25 7:11 UTC
Read the original article Hit count: 690

Filed under:
|
|
|

Followed the instructions on the Rails wiki and have had success connecting to SQL Server 2000 with TSQL -- both with DSN-less and DNS connections. I'm running Mac OS X 10.6.3.

Wiki instructions here.

Installed ruby-odbc, dbi (0.4.0), dbd-odbc (2.4.5), activerecord-sqlserver-adapter (2.3.5).

In my database.yml (Rails 2.3.6):

development:
  adapter: sqlserver
  mode: ODBC
  dsn: 'DRIVER=/usr/local/lib/libtdsodbc.so;TDS_Version=8.0;SERVER=mssql01.discountasp.net;DATABASE=DB_164368_dmusd;Port=1433;uid=DB_164368_dmusd_user;pwd=Schools77;'

This yields the following error: ODBC::Error: S1090 (0) [unixODBC][Driver Manager]Invalid string or buffer length

When I attempt to use a DSN connection, I get the following error: ODBC::Error: IM002 (0) [unixODBC][Driver Manager]Data source name not found, and no default driver specified

I have in fact verified that the FreeTDS driver (libtdsodbc.so) is installed and the path correct.

Can anyone spot the error of my ways? Thanks in advance.

© Stack Overflow or respective owner

Related posts about sql-server

Related posts about ruby-on-rails