# Connectivity to Microsoft SQL Server using ADO

**URL:** <https://www.ruby-forum.com/t/connectivity-to-microsoft-sql-server-using-ado/81507>\
**Category:** Rails\
**Created:** [March 14, 2006, 12:18am UTC](https://www.ruby-forum.com/t/connectivity-to-microsoft-sql-server-using-ado/81507 "2006-03-14T00:18:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [March 14, 2006, 12:18am UTC](https://www.ruby-forum.com/t/connectivity-to-microsoft-sql-server-using-ado/81507/1 "2006-03-14T00:18:04Z")

</div>

Based on this page:

[http://wiki.rubyonrails.com/rails/pages/HowtoConnectToMicrosoftSQLServer](http://wiki.rubyonrails.com/rails/pages/HowtoConnectToMicrosoftSQLServer)

using this specification

development:  
adapter: sqlserver  
database: database\_name  
host: server\_name  
username: user\_name  
password: your\_pw\_here

in database.yml for your SQL Server connection doesn’t work. Some  
debugging code reveals that only the password comes through into  
sqlserver\_adapter.rb when you use it. I’m not sure why.

NOTE - you still have to copy the ADO.rb file per the HOWTO

However, this seems to work:

development:  
adapter: sqlserver  
database: database\_name  
host: DBI:ADO:Provider=SQLOLEDB;Data Source=localhost,1692  
username: user\_name  
password: your\_pw\_here

Platform:  
Windows XP Professional  
Rails 1.8.2  
DBI 0.2  
ADO 0.1

---

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [March 14, 2006, 1:52am UTC](https://www.ruby-forum.com/t/connectivity-to-microsoft-sql-server-using-ado/81507/2 "2006-03-14T01:52:30Z")

</div>

On 3/13/06, Wes G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> username: user\_name  
> password: your\_pw\_here
> 
> in database.yml for your SQL Server connection doesn’t work. Some  
> debugging code reveals that only the password comes through into  
> sqlserver\_adapter.rb when you use it. I’m not sure why.
> 
> NOTE - you still have to copy the ADO.rb file per the HOWTO

Yes, you need to download/install this properly, but once done, the  
above works just fine for me, but this is assuming one is not using a  
named instance or Windows security.

---

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [March 14, 2006, 1:59am UTC](https://www.ruby-forum.com/t/connectivity-to-microsoft-sql-server-using-ado/81507/3 "2006-03-14T01:59:22Z")

</div>

I am not using Windows authentication, but it is a named instance. Do  
you know why the named instance would matter?

Wes

Corey L. wrote:

> On 3/13/06, Wes G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > username: user\_name  
> > password: your\_pw\_here
> > 
> > in database.yml for your SQL Server connection doesn’t work. Some  
> > debugging code reveals that only the password comes through into  
> > sqlserver\_adapter.rb when you use it. I’m not sure why.
> > 
> > NOTE - you still have to copy the ADO.rb file per the HOWTO
> 
> Yes, you need to download/install this properly, but once done, the  
> above works just fine for me, but this is assuming one is not using a  
> named instance or Windows security.
