A
Ana Lopez
Hello everyone,
I have been looking all over to see if I can get my problem resolved and
alas, I have not been successful. Could someone help?
I am trying to connect to a database in XP that resides on a SQL Server
2005. I downloaded and installed the Ruby-One-Time-Installer, so that
gives me the odbc package.
The question is, how do I specify the datasource address if the database
is residing on a server not on my local machine?
Here is a snip of my code:
require 'DBI'
conn =
DBI.connect('DBI:ODBC:fooServer\fooDevServer\Databases\db',username,password)
Is this correct? I have changed to forward slashes, to colons, but to no
avail. I keep getting the following error:
C:/INSTAN~1/ruby/lib/ruby/site_ruby/1.8/DBD/ODBC/ODBC.rb:95:in
`connect': IM002 (0) [Microsoft][ODBC Driver Manager] Data source name
not found and no default driver specified (DBI:atabaseError)
from C:/INSTAN~1/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:584:in
`connect'
from C:/INSTAN~1/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:384:in
`connect'
from Database_test.rb:18
Can someone let me know what I am missing?
Thanks,
Ana
I have been looking all over to see if I can get my problem resolved and
alas, I have not been successful. Could someone help?
I am trying to connect to a database in XP that resides on a SQL Server
2005. I downloaded and installed the Ruby-One-Time-Installer, so that
gives me the odbc package.
The question is, how do I specify the datasource address if the database
is residing on a server not on my local machine?
Here is a snip of my code:
require 'DBI'
conn =
DBI.connect('DBI:ODBC:fooServer\fooDevServer\Databases\db',username,password)
Is this correct? I have changed to forward slashes, to colons, but to no
avail. I keep getting the following error:
C:/INSTAN~1/ruby/lib/ruby/site_ruby/1.8/DBD/ODBC/ODBC.rb:95:in
`connect': IM002 (0) [Microsoft][ODBC Driver Manager] Data source name
not found and no default driver specified (DBI:atabaseError)
from C:/INSTAN~1/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:584:in
`connect'
from C:/INSTAN~1/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:384:in
`connect'
from Database_test.rb:18
Can someone let me know what I am missing?
Thanks,
Ana