require 'phi'; include Phi
require 'rdb'; include RDB
require 'com'

form = Component._load open('Unit1.afm', 'rb').read

require 'control_tree.rb'

p form.ado_connection1.properties['Transaction DDL'].value
p DBPROPVAL_TC_NONE

form.panel1.button1.on_click = proc do |sender|
  begin
    form.ado_connection1.begin_trans
  rescue
    p $!
  end
end

form.panel1.button2.on_click = proc do |sender|
  begin
    form.ado_connection1.commit_trans
  rescue
    p $!
  end
end

form.panel1.button3.on_click = proc do |sender|
  begin
    form.ado_connection1.rollback_trans
  rescue
    p $!
  end
end

form.show
Phi.mainloop
GC.start
raise
