Forum: Ruby on Rails Problem connecting with an SQL Server 2000 database

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Steven D. (Guest)
on 2006-03-28 13:54
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/HowtoConne...
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.
Doug L. (Guest)
on 2006-03-28 14:03
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.
Steven D. (Guest)
on 2006-03-28 18:42
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.
Brian H. (Guest)
on 2006-03-29 00:06
(Received via mailing list)
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.
Steven D. (Guest)
on 2006-03-29 14:08
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.
Brian H. (Guest)
on 2006-04-06 16:06
(Received via mailing list)
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?
Peter F. (Guest)
on 2006-04-06 23:03
(Received via mailing list)
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!

--
Steven D. (Guest)
on 2006-04-07 12:14
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 :)

Any suggestions?

Steven.
This topic is locked and can not be replied to.