From: Dejan Dimic Date: 2008-08-06T22:38:22+09:00 Subject: Re: ruby dbi and sql server 2000 On Aug 6, 3:00 pm, aidy wrote: > I hava a class that connects to SQL Server 2000 > > class SQLServerConnection >     attr_reader :row > >     def initialize(server_name, db) >       @db = db >       @dbh=DBI.connect("DBI:ADO:Provider=SQLOLEDB;Data > Source=#{server_name};Intitial Catalog=#{@db};Integrated > Security=SSPI") >    end > >     def execute_sql(sql) >       @dbh.execute("USE #{@db}") >       sth = @dbh.prepare(sql) >       sth.execute >       @row=sth.fetch >     end >   end > >   sql_server = SQLServerConnection.new('v-w-dcs-test1', > 'DcsOrderTracking') >   sql_server.execute_sql("DELETE FROM [OrderLineStatus]") > >    I am receiving this error > >    DBI::DatabaseError: EOF > >    OLE error code:800A0E78 in ADODB.Recordset > >    Operation is not allowed when the object is closed. > >    HRESULT error code:0x80020009 > >    Exception occurred. > >    But I am not sure why. > >    Any ideas? > >    Thanks > >    Aidy Take look at http://www.kitebird.com/articles/ruby-dbi.html