From: Michael Neumann Date: 2004-10-12T14:04:51+09:00 Subject: Re: 2 key user questions on Ruby-SQL nkb wrote: > Hi. > 1. Is it possible to access SQL data for simple query like Select, > Update etc. via Ruby? > 2. Most SQL databases require user authentication. I'm on SQL 2000. I am > able to access SQL via my vb script since microsoft is able to simply > use my windows NT login as the authentication to the SQL. Can this be > done for Ruby? I dont wish to explicitly enter my password since this > script needs to run background. yes and yes. Try either Ruby/ODBC or the ODBC database driver of Ruby/DBI. http://www.ch-werner.de/rubyodbc http://ruby-dbi.rubyforge.org In Ruby/DBI it could look like this: require 'dbi' DSN = 'fill in' # the ODBC datasource name DBI.connect("DBI:ODBC:#{DSN}", "user", "passwd") do |dbh| dbh.execute("SELECT * FROM table") do |sth| # iterate over each row of the result set sth.each do |row| p row end end end Hope this helps. Regards, Michael