Problems with sqlserver 2000 and ActiveRecord


I'm getting some trouble in connecting to a sql server 2000
database with ActiveRecord-2.0.1 and ruby 186-26, from
win XP.

Using the next conenction config:

  :adapter => "sqlserver",
  :database => "nombre_bd",
  :username => "usu",
  :password => "contra"

I have the next error:

C:/ruby/lib/ruby/site_ruby/1.8/dbi.rb:329:in `load_driver': Unable to
load driver 'ADO' (DBI::InterfaceError)

I don't understand whre's the matter, i have installed the client tools
of sql server 2000 and 2005, and i have installed visual studio 2005
too (i should have installed the sql server ado provider).

If i try using ODBC, neither works. I can connect to database, and some
querys work, but in a quey i get a memory error:

dapters/abstract_adapter.rb:150:in `log': NoMemoryError: negative
allocation siz
e (or too big): SELECT * FROM si_Empresas WHERE
(si_Empresas.[IdEmpresa] = 227
2) (ActiveRecord::StatementInvalid)

Any idea will be appreciated,



See this to solve the DBI problem - sounds like you’re missing a file.

As for ODBC, I have no idea what’s wrong there - we use it constantly here from Linux or Windows with no problems. On Windows, ADO seems to perform better for us though.

Thank you,

It is working now.

It's an strange issue, i amb working with ActiveRecord-2, but
my ruby installation does not had any ADO class (ADO.rb file).

I have downloaded the last dbi package, and copied to my ruby
install, and works.


Brian Hogan wrote:


I have the same trouble.

I do :
ruby setup.rb config --with=dbi
ruby setup.rb setup
ruby setup.rb install

But I don't understand where to put the package of DBI ?

Unarchive it in the lib of ruby ?
Copy directly the archive in the lib ?
Is there any command to execute after that ?


Miguel angel Garcia roig wrote:


You should download the last ruby-dbi package from

uncompress it and copy the file lib/dbd/ADO.rb
to your ruby install, in


(make directories as required to create the full path)


Frédérick Fredo wrote: