Created
July 8, 2014 04:45
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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