string ls_temp declare readdate dynamic cursor for sqlsa; string ls_sql="select ROLENAME from T_ROLE" prepare sqlsa from :ls_sql; open dynamic readdate; do while sqlca.sqlcode=0 fetch readdate into:ls_temp; if sqlca.sqlcode=0 then tab_1.tabpage_1.ddlb_1.additem(ls_temp) end if loop tab_1.tabpage_1.ddlb_1.SelectItem(2) close readdate;
說明:這是PB中游標的一種高級應用,經過定義遊標來循環讀取數據集中的一行數據,而後把數據additem()加入dropdownlistbox中。sql