Re: EDS Database Problem
- Posted by Greg Haberek <ghaberek at gmail.com> Jun 11, 2005
- 492 views
> procedure Test() > integer findrecord > sequence selecteditem,item > > selecteditem = getLVSelected(MyList) > > item = getLVItemText(MyList, selecteditem[1],1) > if db_select_table("Table1") != DB_OK then > end if > findrecord = db_find_key(item) > db_delete_record(findrecord) > end procedure If you're just grabbing the first column of text, use getLVSelectedText() instead of getLVSelected() and getLVItemText(). That should help iron out some wrinkles. Also, a little more fact checking always helps spot a few bugs. I re-worked your routine, give it a shot and see if it works.
procedure Test() sequence selected integer rec selected = getLVSelectedText( MyList ) if length(selected) = 0 then -- no items selected return end if if db_select_table("Table1") != DB_OK then -- table not available return end if -- walk 'up' the items, deleting each one for i = length(selected) to 1 by -1 do rec = db_find_key( selected[i] ) if rec > 0 then -- record found, delete it db_delete_record( rec ) end if end for end procedure