A
Anukul Singhal
Hi,
I used the following code to connect to SQL Server:
require 'win32ole'
server = WIN32OLE.new('SQLDMO.SQLServer')
server.connect('113.212.133.232,1423','username','password')
database = server.Databases('DIT_Photon_1007')
for table in database.Tables
puts table.Name
end
When i execute this, it successfully gives me all the table names for
the DB ('DIT_Photon_1007')
But I want to execute a query, and for that I am using this code:
output = database.execute('Select * from dbo.tLNPOrderStatus')
puts output
But I am getting the error like "method missing"
(Execute)(WIN32OLERuntimeError)
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
I used the following code to connect to SQL Server:
require 'win32ole'
server = WIN32OLE.new('SQLDMO.SQLServer')
server.connect('113.212.133.232,1423','username','password')
database = server.Databases('DIT_Photon_1007')
for table in database.Tables
puts table.Name
end
When i execute this, it successfully gives me all the table names for
the DB ('DIT_Photon_1007')
But I want to execute a query, and for that I am using this code:
output = database.execute('Select * from dbo.tLNPOrderStatus')
puts output
But I am getting the error like "method missing"
(Execute)(WIN32OLERuntimeError)
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