Errr, some catchy title.... RSS 2.0
 Wednesday, September 26, 2007

Here’s the list of thing you have to do in order to connect to Microsoft SQL Server (tested on 2005) with integrated connection (without any usernames passwords).

 

  1. Assuming you have installed Ruby on Rails. Go to Ruby\DBI and get the latest release of ruby-dbi package.
  2. Extract the package to some temporary folder and find file in directory: \lib\dbd\ADO.rb.
  3. Go to location of Rails installation (C:\Ruby by default) and traverse the directory path to: lib\ruby\site_ruby\1.8\DBD\
  4. Create a directory ADO
  5. Copy file ADO.rb (from the extracted package) to the newly created ADO directory.

 

 

This configuration will work for all you Rails applications.

In order to set up a proper connection to your database from your application edit config/database.yml file.

 

Here’s the example of what you should input if you use Windows Authentication.

 

adapter: sqlserver

database: Marcin

username:

password:

host: DBI:ADO:Provider=SQLOLEDB;Data Source=servername,port;Initial Catalog=databasename;Integrated Security=SSPI;Network=networkname_if_necessary;

 

Notice, that since we’re using Integrated Security we’re not leaving username and password blank. This greatly reduces the maintenance of this configuration file.

Wednesday, September 26, 2007 3:17:42 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] -
Ruby
Comments are closed.
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2008
Marcin Waligora
Sign In
All Content © 2008, Marcin Waligora
DasBlog theme 'Business' created by Christoph De Baene (delarou)