A
aidy
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:ADOrovider=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:atabaseError: 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
class SQLServerConnection
attr_reader :row
def initialize(server_name, db)
@db = db
@dbh=DBI.connect("DBI:ADOrovider=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:atabaseError: 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