tirado.carlos
6/4/2007 11:25:00 PM
On 6/4/07, Andy Robbo <arobbo61@hotmail.com> wrote:
>
> I've used ADO before with Access Databases so i'd probably stick with
> what I know, bit stuck as to how I'd get the right syntax for Ruby,
The win32ole library is your friend. This should work (almost direct
copy of VBS code):
require 'win32ole'
ado_con = WIN32OLE.new('adodb.connection')
rs_house = WIN32OLE.new('adodb.recordset')
ado_con.open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" +
base_dir = File.dirname(__FILE__) + "Rent_Management_System_V2.mdb"
str_sql = "Select * From House"
rs_house.open( str_sql, ado_con )