func init blk_vars.println('private OdbcDataReader ' + this.codename + ';') sys.add_var('command', 'OdbcCommand') // initialize properties if(isdef("OdbcConnection")) warning(this.name + ' - manager does not defined') else this.odbc = sys.get_undef_manager("OdbcConnection") end this.setfield('ex', 'ex' + this.id) end func doExec(data) blk.println('try {').inc() blk.println(this.command, ' = ', isdef("OdbcConnection") ? d("OdbcConnection") : this.odbc, '.CreateCommand();') blk.println(this.command, '.CommandText = ', d("SQLquery"), ';') blk.println(this.codename, ' = ', this.command, '.ExecuteReader();') if(linked('onResult')) event('onResult', this.codename) end blk.dec().println('} catch (Exception ', this.ex, ') {').inc() if(linked('onError')) event('onError', this.ex + '.Message') end blk.dec().println('}') end func rsHandle() return(this.codename) end