PB中查询式输入的实现
#1?牐牱椒ㄒ唬?
?牐犘陆ㄒ淮翱冢直鹞涮砑右痪蔡谋尽⒌バ斜嗉蚝土斜砜颍⑸柚盟嵌杂Φ氖粜裕绫恚╚49020502a^)所示:
?牐?1.窗口w_jbxx1的open过程:
?牐爏qlca.dbms = “ODBC”
?牐爏qlca.dbparm = “ConnectString='DSN=cx;UID=dba;PWD=sql'”
?牐燙ONNECT USING SQLCA;
?牐爓_jbxx1.lb_1.visible=false
?牐爓_jbxx1.lb_1.y=w_jbxx1.sle_1.y + w_jbxx1.sle_1.height
?牐爓_jbxx1.lb_1.x=w_jbxx1.sle_1.x
?牐?2.单行编辑框sle_1的modified过程:
?牐爈ong ll_end,ll_find,num
?牐爏tring tempxm,tj
?牐爓_jbxx1.lb_1.visible=true
?牐爓_jbxx1.lb_1.Reset?煟?
?牐爐empxm = trim(w_jbxx1.sle_1.text)??
?牐?//*******定义数据存储对象*******//
?牐燿atastore mhcx_datastore
?牐爉hcx_datastore = CREATE datastore
?牐爉hcx_datastore.DataObject = “d_mhcx”
?牐爉hcx_datastore.SetTransObject(SQLCA)
?牐爉hcx_datastore.Retrieve()
?牐爈l_end = mhcx_datastore.RowCount() + 1
?牐爈l_find = 1
?牐爊um=1
?牐爐j = “trim(name) like ” + “'” +tempxm + “%” + “'”
?牐爈l_find = mhcx_datastore.Find(tj, ll_find,ll_end)
?牐燚O WHILE ll_find > 0
?牐爈l_find = mhcx_datastore.Find?煟╰j, ll_find, ll_end)??
?牐爄f (ll_find = 0) then
?牐爄f num=1 then
?牐爉essagebox(“该库中无此类姓名,请再输入”,“人事管理系统”)
?牐爀nd if
?牐燚ESTROY mhcx_datastore
?牐爀xit
?牐爀lse
?牐爊um=num+1
?牐爈l_find = ll_find + 1
?牐爓_jbxx1.lb_1.AddItem(mhcx_datastore.GetItemString(ll_find - 1, “name”))
?牐爀nd if
?牐燣OOP
?牐?3.列表框lb_1的doubleclicked过程:
?牐爓_jbxx1.sle_1.text=w_jbxx1.lb_1.SelectedItem()
?牐犞链耍迪止碳锤娼崾?
#1?牐牱椒ǘ?
?牐犘陆ㄒ淮翱冢直鹞涮砑右痪蔡谋尽⒌バ斜嗉蚝褪荽翱诳丶⑸柚盟嵌杂Φ氖粜裕绫恚╚49020502b^)所示:
?牐?1.窗口w_jbxx的open过程:
?牐爏qlca.dbms = “ODBC”
?牐爏qlca.dbparm = “ConnectString='DSN=cx;UID=dba;PWD=sql'”
?牐燙ONNECT USING SQLCA;
?牐爓_jbxx.dw_1.SetTransObject(SQLCA)
?牐爓_jbxx.dw_1.Retrieve()
?牐爓_jbxx.dw_1.visible=false
?牐爓_jbxx.dw_1.y=w_jbxx.sle_1.y + w_jbxx.sle_1.height
?牐爓_jbxx.dw_1.x=w_jbxx.sle_1.x
?牐?2.单行编辑框sle_1的modified过程:
?牐爏tring tempxm,DWfilter2
?牐爐empxm = trim(w_jbxx.sle_1.text)
?牐爓_jbxx.dw_1.visible=true
?牐燚Wfilter2 = “name”+“ like ” + “'” + tempxm + “%” + “'”
?牐爓_jbxx.dw_1.SetFilter(DWfilter2)
?牐爓_jbxx.dw_1.Filter()
?牐?3.列表框dw_1的doubleclicked过程:
?牐爓_jbxx.sle_1.text=w_jbxx.dw_1.GetItemString(w_jbxx.dw_1.GetRow(),“name”)
?牐犞链耍迪止碳锤娼崾?
?牐犚陨铣绦蛟赑B 7.0/Sybase SQL Anywhere5.0/Windows 98环境下调试运行通过。