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

form = Form.new

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

database = Database.new 'IBLocal', 'SYSDBA', 'masterkey'
#database.alias_name = 'IBLocal'
#database.database_name = 'IBLocal'
#database.params['user name'] = 'SYSDBA'
#database.params['password'] = 'masterkey' # interbase dafault
#database.login_prompt=false
#database.connected = true

query = Query.new database
#query.database_name = 'IBLocal'
query.sql.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
#database.session.active = false
#database.close
