require "phi"  ; include Phi
require "rdb"  ; include RDB

form = Form.new
grid = DBGrid.new form
grid.align = Phi::AL_CLIENT

connection = SQLConnection.new 'IBLocal'
#connection.login_prompt = false
#connection.load_params_on_connect = true
#connection.connection_name = 'IBLocal'
query = SQLClientDataSet.new connection
#query.db_connection = connection
query.command_type = CT_QUERY

query.command_text = <<EOT
  select * from country
EOT
query.open

data_source = DataSource.new query

query.after_scroll = proc {
  print 'COUNTRY=',query['COUNTRY'],', CURRENCY=',query['CURRENCY'],"\n"
}

grid.data_source = data_source
form.show
Phi.mainloop
