# Sql Server 2005

**URL:** <https://www.ruby-forum.com/t/sql-server-2005/66611>\
**Category:** Ruby\
**Created:** [August 27, 2006, 9:07pm UTC](https://www.ruby-forum.com/t/sql-server-2005/66611 "2006-08-27T21:07:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [August 27, 2006, 9:07pm UTC](https://www.ruby-forum.com/t/sql-server-2005/66611/1 "2006-08-27T21:07:07Z")

</div>

I’m trying to follow the “rolling with ruby on rails”  
([http://shrinkster.com/hrp](http://shrinkster.com/hrp)) tutorial, but want to get it working with  
SQL server express instead of mysql.

I did all of the recommended steps I cound find:

I copied ado.rb to X:/ruby/lib/ruby/site\_ruby/1.8/DBD/ADO/ADO.rb

I reworked by database.yml file to point to the new database:

development:  
adapter: sqlserver  
database: cookbook  
host: DBI:ADO:Provider=SQLOLEDB;Data  
Source=localhost\sqlexpress;Initial Catalog=cookbook;integrated  
security=sspi

I have rails 1.1 which I just installed today (8/27/06)

When I try to access a page that should connect to this database, I get  
an exeption with the following (abbreviated) stack trace that suggests  
that mysql.rb is being used instead of ado.rb

Any help would be greatly appreciated.

John

c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active\_record/vendor/mysql.rb:108:in  
`initialize' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/vendor/mysql.rb:108:in `real\_connect’  
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active\_record/connection\_adapters/mysql\_adapter.rb:330:in  
`connect' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/mysql_adapter.rb:87:in `initialize’  
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active\_record/connection\_adapters/mysql\_adapter.rb:36:in  
`mysql_connection' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/abstract/connection_specification.rb:251:in `connection\_without\_query\_cache=’  
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active\_record/query\_cache.rb:54:in  
`connection=’

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [August 29, 2006, 3:08pm UTC](https://www.ruby-forum.com/t/sql-server-2005/66611/2 "2006-08-29T15:08:29Z")

</div>

unknown wrote:

> I’m trying to follow the “rolling with ruby on rails”  
> ([http://shrinkster.com/hrp](http://shrinkster.com/hrp)) tutorial, but want to get it working with  
> SQL server express instead of mysql.
> 
> I did all of the recommended steps I cound find:
> 
> I copied ado.rb to X:/ruby/lib/ruby/site\_ruby/1.8/DBD/ADO/ADO.rb
> 
> I reworked by database.yml file to point to the new database:
> 
> development:  
> adapter: sqlserver  
> database: cookbook  
> host: DBI:ADO:Provider=SQLOLEDB;Data  
> Source=localhost\sqlexpress;Initial Catalog=cookbook;integrated  
> security=sspi
> 
> I have rails 1.1 which I just installed today (8/27/06)
> 
> When I try to access a page that should connect to this database, I get  
> an exeption with the following (abbreviated) stack trace that suggests  
> that mysql.rb is being used instead of ado.rb
> 
> Any help would be greatly appreciated.

I had a similar problem, albeit not with Ruby on Rails.

Run the setup to use ADO:

ruby setup.rb config --with=dbi, dbd\_ado  
ruby setup.rb setup  
ruby setup.rb install
