From: "Morris, Chris" Date: 2002-01-18T22:53:00+09:00 Subject: RE: Is there a way to use Sql server database with ruby? > I have installed unixodbc and rubyodbc . I try to test the > connection to my > sql7 server > > The syntax is : ruby test.rb DSN [uid] [pwd] > but what is exactly DSN ? DataSource Name. If you're on Windows NT, open Control Panel, ODBC Data Sources (w2k it's under Administrative Tools). You can set one up in there. However, I usually don't use DSNs, plus I assume you're on unix, which I have no idea if it supports dsns (contact the Ruby/ODBC author, he might know), so you can go a more direct route with drvconnect: def getDB(server, database, user, password) drv = ODBC::Driver.new drv.name = "SQL Server" drv.attrs["server"] = server drv.attrs["database"] = database drv.attrs["uid"] = user drv.attrs["pwd"] = password drv.attrs["driver"] = "SQL Server" db = ODBC::Database.new db.drvconnect(drv) db end The attribute values for the connection string will vary from driver to driver, but the above works for SQL 7. Chris