Hello I'm switching some scripts over to Ruby from VBS. One of my scripts talks with a small Access database. So far, I've been able to connect to the database with win32ole, and bring back results of a query. The problem is, I can't seem to figure out how to pull up the results of a query by providing a single field name. For example, my VBS code would look something like this recordset.Open("SELECT * FROM TABLENAME WHERE FIELDNAME1 = 'somestring'") recordset.MoveFirst do until recordset.EOF = true variable1 = recordset("FIELDNAME1") variable2 = recordset("FIELDNAME2") #and some other processing here, etc end if What I'm asking is, is it possible to process data from a recordset by referencing the FIELDNAME in Ruby? I'm using the example from http://rubyonwindows.blogspot.com/2007/06/using-ru... but I can only seem to pull field data by referencing the index number (recordset) of that field, and not the field name recordset['FIELDNAME']. Thanks!
on 2009-09-04 17:58
on 2009-09-04 18:00
Sorry, meant to post this in the Ruby forum. Mods please move it there. Thanks.