On Aug 4, 3:02 pm, "Pablo Q." <[email protected]> wrote:
> Hi Jeremy,
>
> I have solved the connection (using odbc) doing like this:
>
> db  = Sequel.connect(:adapter=>'odbc',:driver=>'SQL
> Server',:server=>'localhost',:uid=>user,:pwd=>pass,:database=>mydb,:db_type=>'mssql')

Well, I'm glad that is working for you.

> 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)

ODBC::Database.drvconnect is a C function that is returning the
error.  On a hunch, see if the following patch fixes it:

diff --git a/lib/sequel/adapters/odbc.rb b/lib/sequel/adapters/odbc.rb
index 2bbe0da..0e11767 100644
--- a/lib/sequel/adapters/odbc.rb
+++ b/lib/sequel/adapters/odbc.rb
@@ -29,7 +29,7 @@ module Sequel
             if :driver == param and not (value =~ GUARDED_DRV_NAME)
               value = DRV_NAME_GUARDS % value
             end
-            drv.attrs[param.to_s.capitalize] = value
+            drv.attrs[param.to_s.capitalize] = value.to_s
           end
           db = ::ODBC::Database.new
           conn = db.drvconnect(drv)

> 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'

This would be my recommended way to use it, but as I mentioned in my
last response, you need to setup an ODBC DSN for it to work.

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
-~----------~----~----~----~------~----~------~--~---

Reply via email to