# How to connect to microsoft sql server 6.5

**URL:** <https://www.ruby-forum.com/t/how-to-connect-to-microsoft-sql-server-6-5/195995>\
**Category:** Rails\
**Created:** [October 5, 2010, 12:44am UTC](https://www.ruby-forum.com/t/how-to-connect-to-microsoft-sql-server-6-5/195995 "2010-10-05T00:44:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![totosbien](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e19b73/32.png) [@totosbien](https://www.ruby-forum.com/u/totosbien)\
**Post date:** [October 5, 2010, 12:44am UTC](https://www.ruby-forum.com/t/how-to-connect-to-microsoft-sql-server-6-5/195995/1 "2010-10-05T00:44:13Z")

</div>

Hi all,  
i’m beginner in rails world…i try to connect my rails application on  
a db sql server 6.5 without success, ca you help me?  
i try odbc driver, jtds e activerecord-sqlserver-adapter but  
nothing…  
what are the right gems or the right sequence procedure?

thx  
Prinx

---

<div class="post-metadata">

**Author:** ![totosbien](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e19b73/32.png) [@totosbien](https://www.ruby-forum.com/u/totosbien)\
**Post date:** [October 5, 2010, 2:41pm UTC](https://www.ruby-forum.com/t/how-to-connect-to-microsoft-sql-server-6-5/195995/2 "2010-10-05T14:41:43Z")

</div>

I only know about SQLServer 2005 and 2008, not 6.5. Anyway, here is a  
list of things I had to do to get a project working with 2005 using  
Ruby 1.8.6, Rails 2.3.5 and Mongrel as the web server. You might need  
to skip/change some of the steps. I hope it helps:

1. Install Ruby (1.8.6): [Download Ruby](http://www.ruby-lang.org/en/downloads/)
2. Install rubygems:  
a. [Download RubyGems | RubyGems.org | your community gem host](http://rubygems.org/pages/download) (zip version)  
b. Unpack to a directory and cd there  
c. ruby setup.rb
3. Install rails: gem install rails –v=2.3.5
4. Install mongrel: gem install mongrel
5. Install mongrel service: gem install mongrel\_service
6. Install SQL Server adapter: gem install activerecord-sqlserver-  
adapter
7. Install ODBC gem: gem install odbc-rails
8. Install authentication gem: gem install authlogic
9. Install encryption gem: gem install attr\_encrypted
10. Install SQL Server Management utility (from Microsoft)
11. Create SQL Server DB
12. Create login in SQL Server
13. Create DB user
14. Create DSN in Windows:  
a. Control Panel → Adminstrative Tasks → Data Sources (ODBC)  
b. Click on System DSN → Add  
c. Select type SQL Server  
i. Name: _Give it a name_  
ii. Description: _Give it a description_  
iii. Server: Server name (_whatever name you can see in the SQL  
Server Management Utility_)  
iv. Use SQL Authentication

---

<div class="post-metadata">

**Author:** ![totosbien](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e19b73/32.png) [@totosbien](https://www.ruby-forum.com/u/totosbien)\
**Post date:** [October 7, 2010, 8:05am UTC](https://www.ruby-forum.com/t/how-to-connect-to-microsoft-sql-server-6-5/195995/3 "2010-10-07T08:05:50Z")

</div>

Ok, i’ll try yours advice, i hope to do it…  
I will let you know 🙂

Thank’s  
Prinx

---

<div class="post-metadata">

**Author:** ![totosbien](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e19b73/32.png) [@totosbien](https://www.ruby-forum.com/u/totosbien)\
**Post date:** [October 6, 2010, 2:52pm UTC](https://www.ruby-forum.com/t/how-to-connect-to-microsoft-sql-server-6-5/195995/4 "2010-10-06T14:52:46Z")

</div>

Forgot to add database.yml configuration. Here it is:

your\_environment\_here:  
adapter: sqlserver  
mode: odbc  
dsn: your\_dsn\_name\_here  
username: your\_username\_here  
password: your\_password\_here

There is no need to use host or port parameter since we’re using a  
DSN.
