On Sep 19, 8:04 pm, gregh <[email protected]> wrote:
> Thanks for all comments. I usually use the win32ole to work with the
> excel object. I just thought for some tasks sequel looked nice and
> concise.
>
> One way without sequel:
>
> require 'win32ole'
> conn_string =  'Provider=Microsoft.Jet.OLEDB.4.0;'
> conn_string << 'Data Source=C:\mydata\my_file.xls;'
> conn_string << 'Extended Properties=Excel 8.0;'
>
> connection = WIN32OLE.new('ADODB.Connection')
> connection.Open(conn_string)
> recordset = WIN32OLE.new('ADODB.Recordset')
>
> sql="SELECT * FROM cam;"
>
> recordset.Open(sql, connection)
> data = recordset.GetRows.transpose
> p data
> connection.close
>
> outputs:
> [[1.0, "north"], [2.0, "south"], [3.0, "east"], [4.0, "west"]]
>
> My original soulution set up a dsn. As a new reporting period rolls
> over, the files are archived in a new path. With the locations
> changing, I just didn't want to go thru the admin panel to change the
> dsn.
>
> Is it possible to get similar connection with DB=Sequel.ado()?

Not currently, but try the patch at http://pastie.org/623708 and the
following connection code:

  Sequel.ado(:conn_string=>'Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\mydata\my_file.xls;Extended Properties=Excel 8.0;')

Please let me know whether that works.

Jeremy
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to