Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Ruby | Ruby on Rails | database MS SQL Server 2005

Reply
Thread Tools

Ruby | Ruby on Rails | database MS SQL Server 2005

 
 
Erstwhile Joe
Guest
Posts: n/a
 
      09-26-2007
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:ADOrovider=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/.

 
Reply With Quote
 
 
 
 
Mark Gallop
Guest
Posts: n/a
 
      09-26-2007
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',
assword => 'bob')

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

Cheers,
Mark

 
Reply With Quote
 
 
 
 
rubygujarat@gmail.com
Guest
Posts: n/a
 
      09-27-2007
On Sep 26, 9:57 am, Mark Gallop <(E-Mail Removed)> 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',
> assword => '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

 
Reply With Quote
 
Damjan Rems
Guest
Posts: n/a
 
      09-27-2007
unknown wrote:
> On Sep 26, 9:57 am, Mark Gallop <(E-Mail Removed)> wrote:
>> :mode => 'odbc',
>> :dsn => 'MyDSName',
>> :username => 'bob',
>> assword => '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/.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to remote connect to the SQL server 2005 when th ere is a‘\’ in the SQL server name, such as 192.168.0.1 1\active? Wesley Chen Ruby 0 04-07-2009 10:23 AM
Help. Getting a An error has occurred while establishing a connectionto the server. When connecting to SQL Server 2005, this failure may be causedby the fact that under the default settings SQL Server does not allow remote aboutjav.com@gmail.com ASP .Net 0 05-03-2008 12:43 PM
MCITP SQL Server 2005 or SQL Server 2008 Darrilgibson@gmail.com MCITP 0 12-19-2007 01:56 PM
SQL Server 2005 + SQL Server Express farseer ASP .Net 3 08-08-2006 04:07 AM
Wohoo! VS.NET 2005/ASP.NET 2.0/SQL Server 2005/BizTalk Server 2006 will launch week of Nov. 7 Juan T. Llibre ASP .Net 0 06-07-2005 05:19 PM



Advertisments