Skip to content

Instantly share code, notes, and snippets.

@sohooo
Forked from rjattrill/dsnless-odbc-sequel.rb
Created January 20, 2018 17:17
Show Gist options
  • Save sohooo/c74fc342b4ad3399f38be131cfa30953 to your computer and use it in GitHub Desktop.
Save sohooo/c74fc342b4ad3399f38be131cfa30953 to your computer and use it in GitHub Desktop.
DSN-less ODBC Connection with ruby-sequel
require 'sequel'
DB = Sequel.connect(:adapter=>'odbc',:driver=>'SQL Server Native Client 10.0',:server=>'localhost',:port=>1433, :uid=>'myuser',:pwd=>'mypass',:db_type=>'mssql')
DB.fetch("SELECT * FROM artist") do |row|
puts row
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment