Module: ActiveRecord

Defined in:
lib/active_record/base.rb,
lib/active_record/locking.rb,
lib/active_record/observer.rb,
lib/active_record/acts/list.rb,
lib/active_record/acts/tree.rb,
lib/active_record/callbacks.rb,
lib/active_record/timestamp.rb,
lib/active_record/wrappings.rb,
lib/active_record/reflection.rb,
lib/active_record/validations.rb,
lib/active_record/aggregations.rb,
lib/active_record/associations.rb,
lib/active_record/transactions.rb,
lib/active_record/wrappers/yaml_wrapper.rb,
lib/active_record/deprecated_associations.rb,
lib/active_record/associations/association_proxy.rb,
lib/active_record/associations/has_one_association.rb,
lib/active_record/associations/has_many_association.rb,
lib/active_record/connection_adapters/mysql_adapter.rb,
lib/active_record/connection_adapters/sqlite_adapter.rb,
lib/active_record/associations/association_collection.rb,
lib/active_record/associations/belongs_to_association.rb,
lib/active_record/connection_adapters/abstract_adapter.rb,
lib/active_record/connection_adapters/sqlserver_adapter.rb,
lib/active_record/connection_adapters/postgresql_adapter.rb,
lib/active_record/associations/has_and_belongs_to_many_association.rb

Overview

sqlserver_adapter.rb – ActiveRecord adapter for Microsoft SQL Server

Author: Joey Gibson <[email protected]> Date: 10/14/2004

REQUIREMENTS:

This adapter will ONLY work on Windows systems, since it relies on Win32OLE, which, to my knowledge, is only available on Window.

It relies on the ADO support in the DBI module. If you are using the one-click installer of Ruby, then you already have DBI installed, but the ADO module is NOT installed. You will need to get the latest source distribution of Ruby-DBI from ruby-dbi.sourceforge.net/ unzip it, and copy the file src/lib/dbd_ado/ADO.rb to X:/Ruby/lib/ruby/site_ruby/1.8/DBD/ADO/ADO.rb (you will need to create the ADO directory). Once you’ve installed that file, you are ready to go.

This module uses the ADO-style DSNs for connection. For example: “DBI:ADO:Provider=SQLOLEDB;Data Source=(local);Initial Catalog=test;User Id=sa;Password=password;” with User Id replaced with your proper login, and Password with your password.

I have tested this code on a WindowsXP Pro SP1 system, ruby 1.8.2 (2004-07-29) [i386-mswin32], SQL Server 2000.

Defined Under Namespace

Modules: Acts, Aggregations, Associations, Callbacks, ConnectionAdapters, Locking, Reflection, Timestamp, Transactions, Validations, Wrappings Classes: ActiveRecordError, AdapterNotFound, AdapterNotSpecified, AssociationTypeMismatch, Base, ConnectionFailed, ConnectionNotEstablished, Errors, Observer, PreparedStatementInvalid, RecordNotFound, SerializationTypeMismatch, StaleObjectError, StatementInvalid, SubclassNotFound