[freetds] dsn-less string for ruby dbi
Jon Connolly
jon at dimax.com
Wed Mar 4 14:11:14 EST 2009
Hi, I am creating a user defined db connector for rails, which will allow
the user to connect to their db. Because of this, using the odbc.ini,
odbcinst.ini, and freetds.conf is not practical. To reiterate, this is a
connection in addition to the Active Record connection. The connection uses
Ruby's DBI library in the form of
DBI.connect('ODBC:MY_DSN', 'user', 'pass')
I would like to add the params string rather than use the freetds.conf and
the two ini files, but I am usure how to do this, or if it can even be done
using the ruby DBI.
I have tried
DBI.connect('ODBC:driver=path/to/driver;server=server;uid=user;pwd=secret
but this does not work. I also looked at the entry on the Freetds user
guide:
http://www.freetds.org/userguide/dsnless.htm#E.G.SAMPLEDSNLESS
Since I am not a C programmer I don't really know how I could use this.
More information about the FreeTDS
mailing list