Skip to content

Instantly share code, notes, and snippets.

@lukeholder
Created July 8, 2014 04:45
Show Gist options
  • Save lukeholder/75e517f2723c98562cdd to your computer and use it in GitHub Desktop.
Save lukeholder/75e517f2723c98562cdd to your computer and use it in GitHub Desktop.
Connect to Timberline Sage 300 from Ruby on Windows through ODBC using the Sequel Gem
require 'sequel'
connection_string = 'driver={Timberline Data};dbq=\\\\doric-server19\\Timberline Office\\Gold\\DORIC GROUP\\;codepage=1252;dictionarymode=0;standardmode=1;maxcolsupport=1536;shortenames=0;databasetype=1;uid=luke;pwd=Awesome;'
db = Sequel.odbc(:driver=>'Timberline Data',:drvconnect=>connection_string)
# I found this returns true sometimes even if the connection is not working.
puts db.test_connection
master_company = db.fetch('SELECT * FROM ABM_MASTER__COMPANY').all
master_company.each do |r|
puts r
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment