Hi folks,
I tried this:
DB = Sequel.connect
(:adapter=>'odbc',:driver=>'Firebird',:server=>'192.168.0.81',:uid=>"xxxxxxx",:pwd=>"xxxxxxx",:database=>"finqueries")
and I get this:
/usr/lib/ruby/gems/1.8/gems/sequel-3.3.0/lib/sequel/database.rb:112:in
`adapter_class': Could not load odbc adapter:
(Sequel::AdapterNotFound)
no such file to load -- odbc
from /usr/lib/ruby/gems/1.8/gems/sequel-3.3.0/lib/sequel/
database.rb:147:in `connect'
from /usr/lib/ruby/gems/1.8/gems/sequel-3.3.0/lib/sequel/
core.rb:73:in `connect'
from /home/jenko/NetBeansProjects/FinQueryAlpha/lib/
test_sequelIB.rb:5
I also tried fully qualifying the :database => value (i.e., "c:/
finqueries/finqueries.ib"), but no help.
Here's my /etc/odbc.ini:
[finqueries]
Description = Firebird
Driver = Firebird
Dbname = 192.168.0.81:c:/finqueries/finqueries.ib
User = xxxxxxx
Password = xxxxxxx
Role =
CharacterSet =
ReadOnly = No
NoWait = No
I verified that the ODBC is set up properly (outside of Sequel) by
connecting via unixodbc isql and issuing "help pricedata" (a table in
my db), and it correctly returned all the fieldnames, etc for that
table. It looks like my Sequel config is off, any ideas?
Thank you!
On Aug 4, 6:02 pm, "Pablo Q." <[email protected]> wrote:
> Hi Jeremy,
>
> I have solved the connection (usingodbc) doing like this:
>
> db = Sequel.connect(:adapter=>'odbc',:driver=>'SQL
> Server',:server=>'localhost',:uid=>user,:pwd=>pass,:database=>mydb,:db_type=>'mssql')
>
> Here are the tracebacks for both issues(in case that it could help
> some how):
>
> db = Sequel.odbc(mydb, :uid=>
> my_user,pwd=>my_pass,:db_type=>'mssql',:driver=>'SQL Server')
>
> c:/ruby/lib/ruby/gems/1.8/gems/sequel-3.3.0/lib/sequel/adapters/odbc.rb:35:in
> `drvconnect': TypeError can't convert Symbol into String
> (Sequel::DatabaseConnectionError)
> from c:/ruby/lib/ruby/gems/1.8/gems/sequel-3.3.0/lib/sequel/
> adapters/odbc.rb:35:in `connect'
> from c:/ruby/lib/ruby/gems/1.8/gems/sequel-3.3.0/lib/sequel/
> database.rb:92:in `initialize'
> from c:/ruby/lib/ruby/gems/1.8/gems/sequel-3.3.0/lib/sequel/
> connection_pool.rb:169:in `call'
> from c:/ruby/lib/ruby/gems/1.8/gems/sequel-3.3.0/lib/sequel/
> connection_pool.rb:169:in `make_new'
> from c:/ruby/lib/ruby/gems/1.8/gems/sequel-3.3.0/lib/sequel/
> connection_pool.rb:156:in `available'
> from c:/ruby/lib/ruby/gems/1.8/gems/sequel-3.3.0/lib/sequel/
> connection_pool.rb:147:in `acquire'
> from c:/ruby/lib/ruby/gems/1.8/gems/sequel-3.3.0/lib/sequel/
> connection_pool.rb:146:in `synchronize'
> from c:/ruby/lib/ruby/gems/1.8/gems/sequel-3.3.0/lib/sequel/
> connection_pool.rb:146:in `acquire'
> ... 6 levels...
> from c:/ruby/lib/ruby/gems/1.8/gems/sequel-3.3.0/lib/sequel/
> dataset/convenience.rb:196:in `single_record'
> from c:/ruby/lib/ruby/gems/1.8/gems/sequel-3.3.0/lib/sequel/
> dataset/convenience.rb:203:in `single_value'
> from c:/ruby/lib/ruby/gems/1.8/gems/sequel-3.3.0/lib/sequel/
> dataset/sql.
> rb:94:in `count'
> from test_db_tools.rb:13
>
> db = Sequel.odbc(mydb, :uid=>my_user,pwd=>my_pass,:db_type=>'mssql')
>
> c:/ruby/lib/ruby/gems/1.8/gems/sequel-3.3.0/lib/sequel/adapters/odbc.rb:37:in
> `initialize':ODBC::Error IM002 (0) [Microsoft][ODBC
> Driver Manager] Data source name not found and no default driver
> specified (Sequel::DatabaseConnectionError)
> from c:/ruby/lib/ruby/gems/1.8/gems/sequel-3.3.0/lib/sequel/
> adapters/odbc.rb:37:in `connect'
> from c:/ruby/lib/ruby/gems/1.8/gems/sequel-3.3.0/lib/sequel/
> adapters/odbc.rb:37:in `connect'
> from c:/ruby/lib/ruby/gems/1.8/gems/sequel-3.3.0/lib/sequel/
> database.rb:92:in `initialize'
> from c:/ruby/lib/ruby/gems/1.8/gems/sequel-3.3.0/lib/sequel/
> connection_pool.rb:169:in `call'
> from c:/ruby/lib/ruby/gems/1.8/gems/sequel-3.3.0/lib/sequel/
> connection_pool.rb:169:in `make_new'
> from c:/ruby/lib/ruby/gems/1.8/gems/sequel-3.3.0/lib/sequel/
> connection_pool.rb:156:in `available'
> from c:/ruby/lib/ruby/gems/1.8/gems/sequel-3.3.0/lib/sequel/
> connection_pool.rb:147:in `acquire'
> from c:/ruby/lib/ruby/gems/1.8/gems/sequel-3.3.0/lib/sequel/
> connection_pool.rb:146:in `synchronize'
> ... 7 levels...
> from c:/ruby/lib/ruby/gems/1.8/gems/sequel-3.3.0/lib/sequel/
> dataset/convenience.rb:196:in `single_record'
> from c:/ruby/lib/ruby/gems/1.8/gems/sequel-3.3.0/lib/sequel/
> dataset/convenience.rb:203:in `single_value'
> from c:/ruby/lib/ruby/gems/1.8/gems/sequel-3.3.0/lib/sequel/
> dataset/sql.
> rb:94:in `count'
> from test_db_tools.rb:13
> -----
>
> Thanks for you time
>
> On Aug 4, 1:50 pm, Jeremy Evans <[email protected]> wrote:
>
> > On Aug 4, 10:44 am, "Pablo Q." <[email protected]> wrote:
>
> > > Hi folks,
>
> > > I need help, I have been trying to connect to sql server usingodbc
> > > without success.
>
> > > This is the code that I'm using:
>
> > > db = Sequel.odbc(mydb, :user=>
> > > my_user,password=>my_pass,:db_type=>'mssql',:driver=>'{SQL Server}')
> > > db[:mytable].count
>
> > > but I received the following error.....
>
> > > ERROR:
>
> > > TypeError can't convert Symbol into String
>
> > Can you give me a full traceback for this? Note that mydb, my_user,
> > and my_pass all need to be strings, not symbols (I'm guessing that's
> > not the problem, as otherwise it wouldn't work below).
>
> > > and when I try without specifying the driver :
>
> > > db = Sequel.odbc(mydb, :user=>
> > > my_user,password=>my_pass,:db_type=>'mssql')
> > > db[:mytable].count
>
> > > ERROR:
>
> > >ODBC::Error IM002 (0) [Microsoft][ODBCDriver Manager] Data Source
> > > name not found sand no default driver specified
>
> > I haven't tried specifying the :driver option. If you are using
> > Windows (at least for XP, not sure about other versions), you can go
> > into Data Sources (ODBC) in the Control Panel and add a User or System
> > DSN for the database. Then you should be able to connect to it
> > without using :driver by just specifying the DSN name as the database
> > to which to connect.
>
> > I use the following connection string to test Sequel with MSSQL and
> >ODBC:odbc:///SQLEXPRESS?db_type=mssql (I'm using Windows integrated
> > authentication, so I don't need to specify the user or password).
>
> > Jeremy
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sequel-talk?hl=en
-~----------~----~----~----~------~----~------~--~---