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 using odbc
> 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][ODBC Driver 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to