From: Anne Burgess Date: 2007-12-21T23:18:53+09:00 Subject: Re: Making ODBC connections without explicitly coding a password Jim Clark wrote: > Anne Burgess wrote: >> We're developing Ruby programs which read and write from/to DB2 tables >> on a mainframe. We're the first people in the company to use Ruby so >> are rather feeling our way. So far we've been using our own IDs and >> passwords, explicitly coded, to make ODBC connections to access >> development tables, but I've learnt that due to our security rules I >> won't be allowed to know the password for the ID which will access live >> tables. Can anyone please suggest a way round explicitly coding the >> password? Thank you. >> > If you are on Windows, you can set up a system DSN with the username and > password encoded there. Using DBI, you can then just reference the DSN > to access the database such as: > > dbh = DBI.connect("DBD:ODBC:myDSN") > > HTH, > Jim Hi Jim Belated but grateful thanks, this worked very nicely. Anne -- Posted via http://www.ruby-forum.com/.