Ruby | Ruby on Rails | database MS SQL Server 2005

Discussion in 'Ruby' started by Erstwhile Joe, Sep 26, 2007.

  1. How can I configure Ruby and Ruby on Rails for use with MS SQL Server
    2005?

    Environment:
    * Ruby 1.8.6-25 (windows)
    * Ruby on Rails 1.2.3
    * ruby-dbi 0.1.1 (installed with dbi,dbd_ado)
    * OS: Windows XP Professional sp4
    * Database: MS SQL Server Express 2005 (bonus and on MS SQL Server
    2000)

    I have attempted to use the following definitions:

    development:
    adapter: sqlserver
    database: event_development
    username: sa
    password: password
    host: DBI:ADO:provider=SQLNCLI;Data Source=localhost;Initial
    Catalog=event_development;User Id=sa;Password=password;

    development:
    adapter: sqlserver
    database: event_development
    username: sa
    password: password
    host: localhost

    development:
    adapter: sqlserver
    database: event_development
    username: sa
    password: password
    host: localhost
    mode: DBI:ADO
    provider: SQLNCLI

    Any help will be appreciated!
    --
    Posted via http://www.ruby-forum.com/.
    Erstwhile Joe, Sep 26, 2007
    #1
    1. Advertising

  2. Erstwhile Joe

    Mark Gallop Guest

    Hi Joe,

    Erstwhile Joe wrote:
    > How can I configure Ruby and Ruby on Rails for use with MS SQL Server
    > 2005?
    >


    I haven't used ADO but have been successfully using ODBC to connect to a
    mssql server. This is how I created the connection:

    ActiveRecord::Base.establish_connection( :adapter => 'sqlserver',
    :mode => 'odbc',
    :dsn => 'MyDSName',
    :username => 'bob',
    :password => 'bob')

    I added bob as a local user (maybe domain users also work) and created
    the ODBC connection called MyDSName.

    Cheers,
    Mark
    Mark Gallop, Sep 26, 2007
    #2
    1. Advertising

  3. Erstwhile Joe

    Guest

    On Sep 26, 9:57 am, Mark Gallop <> wrote:
    > Hi Joe,
    >
    > Erstwhile Joe wrote:
    > > How can I configure Ruby and Ruby on Rails for use with MS SQL Server
    > > 2005?

    >
    > I haven't used ADO but have been successfully using ODBC to connect to a
    > mssql server. This is how I created the connection:
    >
    > ActiveRecord::Base.establish_connection( :adapter => 'sqlserver',
    > :mode => 'odbc',
    > :dsn => 'MyDSName',
    > :username => 'bob',
    > :password => 'bob')
    >
    > I added bob as a local user (maybe domain users also work) and created
    > the ODBC connection called MyDSName.
    >
    > Cheers,
    > Mark


    hi
    Can you kindly helpo me more on this.

    I am using sql2005 express on my machine.

    My server name is : RubyGujarat
    username:- sa
    password:- mytest

    can you help me , how should i mention this in the code given by you
    above.

    Thanks

    IronRuby
    , Sep 27, 2007
    #3
  4. Erstwhile Joe

    Damjan Rems Guest

    unknown wrote:
    > On Sep 26, 9:57 am, Mark Gallop <> wrote:
    >> :mode => 'odbc',
    >> :dsn => 'MyDSName',
    >> :username => 'bob',
    >> :password => 'bob')
    >>
    >> I added bob as a local user (maybe domain users also work) and created
    >> the ODBC connection called MyDSName.
    >>
    >> Cheers,
    >> Mark

    >
    > hi
    > Can you kindly helpo me more on this.
    >
    > I am using sql2005 express on my machine.
    >
    > My server name is : RubyGujarat
    > username:- sa
    > password:- mytest
    >
    > can you help me , how should i mention this in the code given by you
    > above.
    >
    > Thanks
    >
    > IronRuby


    development:
    # adapter: mssqlclient
    adapter: sqlserver
    database: mydb
    host: localhost # or myhost.at.com
    username: myName
    password: myPwd
    charset: unicode

    This was my configuration back when I was testing some stuff. My problem
    was that all number type fields (real, double, fix...) were returned as
    null and it was useless for me.

    You can also try mssqlclient.


    by
    TheR
    --
    Posted via http://www.ruby-forum.com/.
    Damjan Rems, Sep 27, 2007
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Juan T. Llibre
    Replies:
    0
    Views:
    441
    Juan T. Llibre
    Jun 7, 2005
  2. farseer

    SQL Server 2005 + SQL Server Express

    farseer, Aug 7, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    333
    farseer
    Aug 8, 2006
  3. =?Utf-8?B?TmVpbCBQYWRkb2Nr?=

    Connecting to SQL 2000 database with SQL 2005 tools installed

    =?Utf-8?B?TmVpbCBQYWRkb2Nr?=, May 2, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    394
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    May 2, 2007
  4. Wesley Chen
    Replies:
    0
    Views:
    208
    Wesley Chen
    Apr 7, 2009
  5. Wesley Chen
    Replies:
    9
    Views:
    235
    Sean O'Halpin
    Apr 14, 2009
Loading...

Share This Page