# Connecting to SQL Server 2000 database - errors

**URL:** <https://www.ruby-forum.com/t/connecting-to-sql-server-2000-database-errors/62942>\
**Category:** Rails\
**Created:** [June 9, 2006, 7:50pm UTC](https://www.ruby-forum.com/t/connecting-to-sql-server-2000-database-errors/62942 "2006-06-09T19:50:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![harry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/f6c823/32.png) [@harry](https://www.ruby-forum.com/u/harry)\
**Post date:** [June 9, 2006, 7:50pm UTC](https://www.ruby-forum.com/t/connecting-to-sql-server-2000-database-errors/62942/1 "2006-06-09T19:50:52Z")

</div>

I just started investigating Ruby on Rails and am trying the tutorial.  
I need to connect to a SQL Server 2000 database for testing purposes. I  
followed the instructions in the How-To on the wiki for SQL Server. The  
problem is that when attempting to connect to the database I receive the  
following errors:

DBI::DatabaseError in RecipeController#new  
Open  
OLE error code:80004005 in Microsoft OLE DB Provider for SQL Server  
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist  
or access denied.  
HRESULT error code:0x80020009  
Exception occurred.  
RAILS\_ROOT: ./script/…/config/…

I have done a search on google and have not found anything relevant that  
will help me alleviate this error.

I would really like to get this running and see if Ruby on Rails could  
be used to replace my current web site written in HTML/PHP/Javascript.

Thanks in advance for all your help.  
Harry

---

<div class="post-metadata">

**Author:** ![harry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/f6c823/32.png) [@harry](https://www.ruby-forum.com/u/harry)\
**Post date:** [June 9, 2006, 7:57pm UTC](https://www.ruby-forum.com/t/connecting-to-sql-server-2000-database-errors/62942/2 "2006-06-09T19:57:35Z")

</div>

Hello Harry,

I posted some notes I took when I set up the MSDE 2000 on my blog:

[http://www.llafe.com/articles/2006/05/29/sql-server-msde-install-instructions](http://www.llafe.com/articles/2006/05/29/sql-server-msde-install-instructions)

I hope you find the right configuration there.

The most common error is related to the database.yml. In it change the  
host from localhost to (local).

Roland

---

<div class="post-metadata">

**Author:** ![harry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/f6c823/32.png) [@harry](https://www.ruby-forum.com/u/harry)\
**Post date:** [June 9, 2006, 8:23pm UTC](https://www.ruby-forum.com/t/connecting-to-sql-server-2000-database-errors/62942/3 "2006-06-09T20:23:38Z")

</div>

Roland M. wrote:

> Hello Harry,
> 
> I posted some notes I took when I set up the MSDE 2000 on my blog:
> 
> [http://www.llafe.com/articles/2006/05/29/sql-server-msde-install-instructions](http://www.llafe.com/articles/2006/05/29/sql-server-msde-install-instructions)
> 
> I hope you find the right configuration there.
> 
> The most common error is related to the database.yml. In it change the  
> host from localhost to (local).
> 
> Roland

Thanks Roland, I looked at your blog and neither example there worked  
for me. I am running on an XP Professional machine with the SQL Server  
2000 on a Windows Server 2000 machine, not on my local machine. Below  
is the configuration in my yml file.

adapter: sqlserver  
database: cookbook  
username: sa  
password:trustm3  
host: tpagpssql00

---

<div class="post-metadata">

**Author:** ![harry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/f6c823/32.png) [@harry](https://www.ruby-forum.com/u/harry)\
**Post date:** [June 9, 2006, 9:54pm UTC](https://www.ruby-forum.com/t/connecting-to-sql-server-2000-database-errors/62942/4 "2006-06-09T21:54:48Z")

</div>

Jin L. wrote:

> I have the exact same setup as you rails on XP and SQL Server 2000 on  
> Win  
> 2000. If you’ve followed the steps to install ADO.rb, it should work. In  
> my  
> scenario, I have both computers in the same domain, how is your setup?
> 
> Jin

Yes, both computers in the same domain. I can connect to the SQL  
database using Enterprise manager with the same login information but  
unable to connect using ROR.

---

<div class="post-metadata">

**Author:** ![harry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/f6c823/32.png) [@harry](https://www.ruby-forum.com/u/harry)\
**Post date:** [June 9, 2006, 9:14pm UTC](https://www.ruby-forum.com/t/connecting-to-sql-server-2000-database-errors/62942/5 "2006-06-09T21:14:14Z")

</div>

I have the exact same setup as you rails on XP and SQL Server 2000 on  
Win  
2000. If you’ve followed the steps to install ADO.rb, it should work. In  
my  
scenario, I have both computers in the same domain, how is your setup?

Jin

---

<div class="post-metadata">

**Author:** ![harry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/f6c823/32.png) [@harry](https://www.ruby-forum.com/u/harry)\
**Post date:** [June 9, 2006, 10:13pm UTC](https://www.ruby-forum.com/t/connecting-to-sql-server-2000-database-errors/62942/6 "2006-06-09T22:13:06Z")

</div>

Are you sure you have the TCP/IP listener turned on (Does port 1433 show  
up as “LISTENING” when you do a “netstat -na”) ?

It could be that only the Named Pipes channel is active, and the TCP/IP  
channel is disabled.
