On 2/6/07, Nathan <[EMAIL PROTECTED]> wrote:
> Right, I've already tried Google with several variations and nothing there is 
> what I'm looking for - I want to connect to MS SQL WITHOUT rails, and this 
> solution as well as every other solution I've come across has been for rails, 
> which requires a rails server to be running.  I just want plain ruby - it 
> looks like maybe I can create an ODBC connection on windows, then connect to 
> that via DBI somehow, but I can't figure out the connection string.  Does 
> anybody know about this?
>

It's pretty easy.  Go to to Control Panel/Administrative Tools/Data
Sources (ODBC) and set up a System DSN for your database and call it
"mydb"

In ruby, then it's merely a matter of

require 'odbc'
conn = ODBC::connect('mydb','user','password')

or

conn = ODBC::connect('mydb')

if you're using Windows Authentication.
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to