From: Anukul Singhal Date: 2008-05-09T16:00:47+09:00 Subject: Re: Executing SQL Query through ruby using winole32 Michael Linfield wrote: > Anukul Singhal wrote: >> Hi, >> >> Can anybody help me which method would be used to execute a query in >> win32ole? >> I even tried database.query('....'), server.query('....') and >> server.execute('....') but no luck. >> >> Thanks, >> Anukul > > Just out of curiosity, is there a specific reason you're using win32ole? > Using something such as DBI / mysql gems are often times much easier to > use. > > IE: > > require 'mysql' > > server = Mysql.new("hostname","username","password","database") > > results = [] > > qy = server.query("SELECT * FROM table") > > qy.each do |x| > x.each do |z| > results << z > end > end > > Regards, > > - Mac Mac, Thanks for your help. I am using SQL Server, can you help me with the corresponding code for that? Thanks, Anukul -- Posted via http://www.ruby-forum.com/.