problems with dbi to sql server

W

wbsurfver

I'm trying to figure out how to connect to sql server (2005 i think)


this program here, at first used to show the defaukt stuff, ODBC I
think.

DBI.available_drivers.each do |drv|
puts drv
DBI.data_sources(drv).each do |src|
puts " #{src}"
end
end

then I did the config/setup/install with config as shown below for the
dbi stuff I downloaded:

C:\ruby-sql\ruby-dbi>ruby setup.rb config --
with=dbi,dbd_ado,dbd_odbc,dbd_msql,d
bd_mysql,dbd_oracle
entering config phase...
config done.


now the original script above shows nothing, though I see what look
like drivers in a subdirectory called dbd off of my ruby lib and the
following call gives the error shown below:


dbh =
DBI.connect('dbi:ODBC:'+'%q{DRIVER=SQLServer;SERVER=me.my.com;DATABASE=techie;Uid=me;Pwd=*mypass}')




c:/ruby/lib/ruby/site_ruby/1.8/DBD/ODBC/ODBC.rb:95:in `connect': IM002
(0) [Micr
osoft][ODBC Driver Manager] Data source name not found and no default
driver spe
cified (DBI::DatabaseError)
from c:/ruby/lib/ruby/site_ruby/1.8/dbi.rb:424:in `connect'
from c:/ruby/lib/ruby/site_ruby/1.8/dbi.rb:215:in `connect'
from C:/rb-play/tst.rb:19

C:\rb-play>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top