# Problem connecting with an SQL Server 2000 database

**URL:** <https://www.ruby-forum.com/t/problem-connecting-with-an-sql-server-2000-database/88260>\
**Category:** Rails\
**Created:** [March 28, 2006, 11:54am UTC](https://www.ruby-forum.com/t/problem-connecting-with-an-sql-server-2000-database/88260 "2006-03-28T11:54:17Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![S-redyck](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c5a1d2/32.png) [@S-redyck](https://www.ruby-forum.com/u/S-redyck)\
**Post date:** [March 28, 2006, 11:54am UTC](https://www.ruby-forum.com/t/problem-connecting-with-an-sql-server-2000-database/88260/1 "2006-03-28T11:54:17Z")

</div>

Hi,

Iâ??m working on a rails application that uses data from an existing ms  
sqlserver 2000 database.

Unfortunately I canâ??t get the connection to work properly.

I used  
[http://wiki.rubyonrails.com/rails/pages/HowtoConnectToMicrosoftSQLServer](http://wiki.rubyonrails.com/rails/pages/HowtoConnectToMicrosoftSQLServer)  
to make the connection.

- Inserted the ado.rb
- Changed my database.yml to  
development:  
adapter: sqlserver  
database: database\_name  
host: DBI:ADO:Provider=SQLOLEDB;Data Source=server\_name;Initial  
Catalog=database\_name;User Id=user\_name;Password=your\_pw\_here;  
username: user\_name  
password: your\_pw\_here

But I keep getting the following error message:

Open  
OLE error code:800A0E7A in ADODB.Connection  
Provider cannot be found. It may not be properly installed.  
HRESULT error code:0x80020009  
Exception occurred.

Anyone that has/had the same problem? Sollutions? Tips?

Many thanks!

Steven.

---

<div class="post-metadata">

**Author:** ![S-redyck](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c5a1d2/32.png) [@S-redyck](https://www.ruby-forum.com/u/S-redyck)\
**Post date:** [March 28, 2006, 12:03pm UTC](https://www.ruby-forum.com/t/problem-connecting-with-an-sql-server-2000-database/88260/2 "2006-03-28T12:03:04Z")

</div>

Hi – not a DB guru or anything, but just letting you know that I can  
connect to a SQL Server database with the following setup:

adapter: sqlserver  
database: system\_prod  
host: PRODUCTION  
username: sa  
password: nottelling

Just to show that I’ve done it with a simple setup – I’m afraid I’m no  
expert, so can’t be too much help, otherwise!  
BTW – this is an old setup that I’ve just tested again to be sure it  
works – not tried (yet) w/ the latest version of rails.  
Cheers,  
doug.

---

<div class="post-metadata">

**Author:** ![S-redyck](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c5a1d2/32.png) [@S-redyck](https://www.ruby-forum.com/u/S-redyck)\
**Post date:** [March 28, 2006, 4:42pm UTC](https://www.ruby-forum.com/t/problem-connecting-with-an-sql-server-2000-database/88260/3 "2006-03-28T16:42:33Z")

</div>

doug livesey wrote:

> Hi – not a DB guru or anything, but just letting you know that I can  
> connect to a SQL Server database with the following setup:
> 
> adapter: sqlserver  
> database: system\_prod  
> host: PRODUCTION  
> username: sa  
> password: nottelling
> 
> Just to show that I’ve done it with a simple setup – I’m afraid I’m no  
> expert, so can’t be too much help, otherwise!  
> BTW – this is an old setup that I’ve just tested again to be sure it  
> works – not tried (yet) w/ the latest version of rails.  
> Cheers,  
> doug.

I assume you also inserted the Ado.rb file first?

Greets,

Steven.

---

<div class="post-metadata">

**Author:** ![S-redyck](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c5a1d2/32.png) [@S-redyck](https://www.ruby-forum.com/u/S-redyck)\
**Post date:** [March 29, 2006, 12:08pm UTC](https://www.ruby-forum.com/t/problem-connecting-with-an-sql-server-2000-database/88260/4 "2006-03-29T12:08:37Z")

</div>

Brian H. wrote:

> If you’re on Windows, I would question whether or not you have the  
> appropriate SQL Server drivers installed. You usually do this by  
> installing  
> MDAC 2.7 or higher. We have to do this on our app servers before we can  
> connect to SQL Server databases. The error sounds almost identical to  
> the  
> one I see in ASP.
> 
> Or you can install the SQL Server client tools.
> 
> If you’re on Linux, or OSX, then I cannot be of much help.

Hm, …

Wouldn’t that be strangen considering that there are other applications  
that connect to the database without a problem?

Steven.

---

<div class="post-metadata">

**Author:** ![S-redyck](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c5a1d2/32.png) [@S-redyck](https://www.ruby-forum.com/u/S-redyck)\
**Post date:** [April 6, 2006, 2:06pm UTC](https://www.ruby-forum.com/t/problem-connecting-with-an-sql-server-2000-database/88260/5 "2006-04-06T14:06:22Z")

</div>

Yeah it would. However, Ruby might need something from the client tools  
or  
another package that the MS stuff just has access to.

Did you get this figured out?

---

<div class="post-metadata">

**Author:** ![S-redyck](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c5a1d2/32.png) [@S-redyck](https://www.ruby-forum.com/u/S-redyck)\
**Post date:** [March 28, 2006, 10:06pm UTC](https://www.ruby-forum.com/t/problem-connecting-with-an-sql-server-2000-database/88260/6 "2006-03-28T22:06:41Z")

</div>

If you’re on Windows, I would question whether or not you have the  
appropriate SQL Server drivers installed. You usually do this by  
installing  
MDAC 2.7 or higher. We have to do this on our app servers before we can  
connect to SQL Server databases. The error sounds almost identical to  
the  
one I see in ASP.

Or you can install the SQL Server client tools.

If you’re on Linux, or OSX, then I cannot be of much help.

---

<div class="post-metadata">

**Author:** ![S-redyck](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c5a1d2/32.png) [@S-redyck](https://www.ruby-forum.com/u/S-redyck)\
**Post date:** [April 6, 2006, 9:03pm UTC](https://www.ruby-forum.com/t/problem-connecting-with-an-sql-server-2000-database/88260/7 "2006-04-06T21:03:54Z")

</div>

On 4/6/06, Brian H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > If you’re on Windows, I would question whether or not you have the  
> > > If you’re on Linux, or OSX, then I cannot be of much help.  
> > > Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).  
> > > [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

I’ve been connecting to SQL2000 since Rails 0.10.0. If you have further  
questions, please post.  
Also please tell us if you have had success!

–

---

<div class="post-metadata">

**Author:** ![S-redyck](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c5a1d2/32.png) [@S-redyck](https://www.ruby-forum.com/u/S-redyck)\
**Post date:** [April 7, 2006, 10:14am UTC](https://www.ruby-forum.com/t/problem-connecting-with-an-sql-server-2000-database/88260/8 "2006-04-07T10:14:17Z")

</div>

Peter F. wrote:

> On 4/6/06, Brian H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > > > If you’re on Windows, I would question whether or not you have the  
> > > > If you’re on Linux, or OSX, then I cannot be of much help.  
> > > > Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).  
> > > > [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)
> 
> I’ve been connecting to SQL2000 since Rails 0.10.0. If you have further  
> questions, please post.  
> Also please tell us if you have had success!
> 
> –

Nope, haven’t been able to fix it.  
I even installed sql server on my local computer, still doesn’t work.

Last thing I did was creating a mysql db similar to my sql server 2000  
db.  
I put scaffold: activity in my controller. Works perfectly.

Then I added the ado.rb file and changed my database.yml file to  
adapter: sqlserver  
database: database\_name  
host: DBI:ADO:Provider=SQLOLEDB;Data Source=server\_name;Initial  
Catalog=database\_name;User Id=user\_name;Password=your\_pw\_here;  
username: user\_name  
password: your\_pw\_here

And guess what? It doesn’t work 🙂

Any suggestions?

Steven.
