Problem connecting with an SQL Server 2000 database


#1

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
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.


#2

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.


#3

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.


#4

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.


#5

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?


#6

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.


#7

On 4/6/06, Brian H. 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://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!


#8

Peter F. wrote:

On 4/6/06, Brian H. 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://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 :slight_smile:

Any suggestions?

Steven.