def read_sp(sp_text,sr,db,pwd)
conn = WIN32OLE.new('ADODB.Connection')
conn.Open("driver={SQL Server};Uid=sa;server=#{sr};pwd=#{pwd};database=#{db};")
rset = WIN32OLE.new('ADODB.Recordset')
rset.ActiveConnection = conn
rset.Open(sp_text)
s = ""
while not rset.EOF do
for i in (0..rset.Fields.Count - 1) do
s += rset.Fields.Item(i).Value.to_s.strip
end
rset.MoveNext
end
return s;
end
more...
No comments:
Post a Comment