1 2 3 4 |
# This is an Example model file for connecting ActiveRecord to SQL Server 2005/2008 # Make sure you have the following Gems installed on your system: # activerecord, activerecord-sqlserver-adapter, dbi, dbd-odbc # (Can also just run 'gem install activerecord dbi dbd-odbc activerecord-sqlserver-adapter') |
Model.rb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
ActiveRecord( :adapter => "sqlserver", :mode => "odbc", :dsn => 'Driver={SQL Server};Server=SERVER\\INSTANCE;Database=DB', :username => "USERNAME", :password => "PASSWORD" ) end |

