Class | Sequel::ADO::Database
In: | lib/sequel/adapters/ado.rb
Parent: | Sequel::Database

### Methods

connect dataset do execute new

### Public Class methods

new(opts)

[Source]

        # File lib/sequel/adapters/ado.rb, line 18
    18:       def initialize(opts)
    19:         super(opts)
    20:         opts[:driver] ||= 'SQL Server'
    21:         case opts[:driver]
    22:         when 'SQL Server'
    23:           Sequel.require 'adapters/shared/mssql'
    24:           extend Sequel::MSSQL::DatabaseMethods
    25:         end
    26:       end

### Public Instance methods

connect(server)

[Source]

        # File lib/sequel/adapters/ado.rb, line 28
    28:       def connect(server)
    29:         opts = server_opts(server)
    30:         s = "driver=#{opts[:driver]};server=#{opts[:host]};database=#{opts[:database]}#{";uid=#{opts[:user]};pwd=#{opts[:password]}" if opts[:user]}"
    31:         handle = WIN32OLE.new('ADODB.Connection')
    32:         handle.Open(s)
    33:         handle
    34:       end

dataset(opts = nil)

[Source]

        # File lib/sequel/adapters/ado.rb, line 36
    36:       def dataset(opts = nil)
    37:         ADO::Dataset.new(self, opts)
    38:       end

do(sql, opts={})

Alias for execute

execute(sql, opts={}) {|r| ...}

[Source]

        # File lib/sequel/adapters/ado.rb, line 40
    40:       def execute(sql, opts={})
    41:         log_info(sql)
    42:         synchronize(opts[:server]) do |conn|
    43:           r = conn.Execute(sql)
    44:           yield(r) if block_given?
    45:           r
    46:         end
    47:       end

[Validate]