sql server 2005 and odbc-rails
Here’s how I {finally} got mssql 2005 to play nicely with my rails app:
~side-stepping the win32ole db error cannot create new connection because in manual or distributed transaction mode ~
- install odbc-rails using the Manual method. the gem and plugin methods didn’t work out for me.
- i copied Christian Werner’s odbc binding to \lib\ruby\site_ruby\1.8\i386-msvcrt but i believe the Manual method install script adds them (odbc_utf8.so, odbc.so) if they don’t already exist. check for them after running install_odbc.rb. also, Ruby v186 one-click installer includes the odbc.so binary, and i’m using that one instead of Werner’s: so far, so good.
- create a system dsn. in Windows, go to Start | Admin Tools | Data Sources. i created separate dsn’s for test and dev environments.
- database.config looks something like:
test: adapter: odbc dsn: <dsn name> username: <Username> password: <Password> emulate_booleans: false trace: true
emulate_booleans for mssql.
Posted by Luke on Wednesday, September 05, 2007
Comments (1)
Heather on Wednesday, September 05, 2007
Fascinating. Glad to hear it’s working.

