From junkone1 at gmail.com Thu May 19 13:15:46 2011
From: junkone1 at gmail.com (junk one)
Date: Thu, 19 May 2011 13:15:46 -0400
Subject: [ruby-dbi-users] dbi with odbc help requried
Message-ID:
can someone point out where i am makeig a mistake. my odbc connection
seems to connect to sql server successfully but i cannot do it from
ruby.
i am running ruby 1.8.7 (2010-08-16 patchlevel 302) [i386-mingw32]
D:\Documents and Settings\>irb
irb(main):001:0> require 'dbi'
=> true
irb(main):002:0> conn=DBI.connect('LPM','sm_user','smuser_0496')
DBI::InterfaceError: Invalid Data Source Name
from C:/Ruby187/lib/ruby/gems/1.8/gems/dbi-0.4.5/lib/dbi.rb:
333:in `pars
e_url'
from C:/Ruby187/lib/ruby/gems/1.8/gems/dbi-0.4.5/lib/dbi.rb:
159:in `_get
_full_driver'
from C:/Ruby187/lib/ruby/gems/1.8/gems/dbi-0.4.5/lib/dbi.rb:
145:in `conn
ect'
from (irb):2
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From pardee.r at ghc.org Thu May 19 14:32:58 2011
From: pardee.r at ghc.org (Pardee, Roy)
Date: Thu, 19 May 2011 11:32:58 -0700
Subject: [ruby-dbi-users] dbi with odbc help requried
In-Reply-To:
References:
Message-ID: <587F57B26FAA8246A81D10D251EB8AB402897087FE@EXCH07.GHCMASTER.GHC.ORG>
I think your connect string has to start out with the name of a driver. So frx I connect up to a sybase db w/something like this:
SYBASE_CONSTRING = "dbi:ADO:" +
"Provider=MSDASQL;" +
"Persist Security Info=False;" +
"Extended Properties=\"DRIVER={Sybase System 11};UID=my_username;DB=data_warehouse;SRVR=DW_SYBASE;PWD=my_password;\""
DBI.connect(SYBASE_CONSTRING)
For ODBC I assume the provider would be "dbi:ODBC", but am not really sure.
HTH,
-Roy
________________________________
From: ruby-dbi-users-bounces at rubyforge.org [mailto:ruby-dbi-users-bounces at rubyforge.org] On Behalf Of junk one
Sent: Thursday, May 19, 2011 10:16 AM
To: ruby-dbi-users at rubyforge.org
Subject: [ruby-dbi-users] dbi with odbc help requried
can someone point out where i am makeig a mistake. my odbc connection
seems to connect to sql server successfully but i cannot do it from
ruby.
i am running ruby 1.8.7 (2010-08-16 patchlevel 302) [i386-mingw32]
D:\Documents and Settings\>irb
irb(main):001:0> require 'dbi'
=> true
irb(main):002:0> conn=DBI.connect('LPM','sm_user','smuser_0496')
DBI::InterfaceError: Invalid Data Source Name
from C:/Ruby187/lib/ruby/gems/1.8/gems/dbi-0.4.5/lib/dbi.rb:
333:in `pars
e_url'
from C:/Ruby187/lib/ruby/gems/1.8/gems/dbi-0.4.5/lib/dbi.rb:
159:in `_get
_full_driver'
from C:/Ruby187/lib/ruby/gems/1.8/gems/dbi-0.4.5/lib/dbi.rb:
145:in `conn
ect'
from (irb):2
________________________________
GHC Confidentiality Statement
This message and any attached files might contain confidential information protected by federal and state law. The information is intended only for the use of the individual(s) or entities originally named as addressees. The improper disclosure of such information may be subject to civil or criminal penalties. If this message reached you in error, please contact the sender and destroy this message. Disclosing, copying, forwarding, or distributing the information by unauthorized individuals or entities is strictly prohibited by law.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: