Connect rails application to MsSQL 2005 from Windows

Posted by Enrico Carlesso on Stack Overflow See other posts from Stack Overflow or by Enrico Carlesso
Published on 2010-04-16T07:37:29Z Indexed on 2010/04/16 7:53 UTC
Read the original article Hit count: 427

Filed under:
|
|

Hi guys.

I (sadly) have to deploy a rails application on Windows XP which has to connect to Microsoft SQL Server 2005.

Surfing in the web there are a lot of hits for connect from Linux to MsSQL, but cannot find out how to do it from Windows.

Basically I followed these steps:

  • Install dbi gem
  • Install activerecord-sql-server-adapter gem

My database.yml now looks like this:

development:
  adapter: sqlserver
  mode: odbc
  dsn: test_dj
  host: HOSTNAME\SQLEXPRESS
  database: test_dj
  username: guest
  password: guest

But I'm unable to connect it. When I run rake db:migrate I get

IM002 (0) [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

I'm not a Windows user, so cannot understand really well the meaning of dsn element or so. Does someone have an idea how to solve this?

Thanks in advance

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about mssql2005