FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour method add, del in DBCOMBO
Posts: 357
Joined: Thu Nov 02, 2006 06:53 PM
method add, del in DBCOMBO
Posted: Tue Dec 20, 2016 09:24 PM

if there is method in DBCOMBO with add or del an item form list /list - database/

maybe an example

best regards

kajot
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: method add, del in DBCOMBO
Posted: Fri Mar 03, 2017 05:53 PM

It all depends on what you need to do.

DBCombo can load an array or read a source database.

If you are reading a small database, you can add or delete records in the source database, then just call the Refill() method which will reload the array.

Depending on the size of the database rereading it could be too slow for a good user experience. If this is the case, then you can add/delete data directly to the existing array using the existing Add() and Del() methods to change the list. Then you need to also add/delete to the source database also.

If you are just using a list (and not a database) then just use the Add() or Del() methods.

Regards,
James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 2064
Joined: Fri Jan 06, 2006 09:28 PM
Re: method add, del in DBCOMBO
Posted: Fri Mar 03, 2017 07:55 PM
Saludos, yo lo hago asi, espero te ayude...saludos... :-)

Code (fw): Select all Collapse
// REASIGNO VALORES A UN DBCOMBO

local aNuevo1 := {"1","2","3","4"}, aNuevo2 := {"Valor 1","Valor 2", "Valor 3", "Valor 4"}

   oCmb:aItems := aNuevo1

   oCmb:aList  := aNuevo2

   oCmb:SetItems( oCmb:aItems, oCmb:aList, .t. )

   aVar[5] := "0"

   oCmb:REFRESH()
Dios no está muerto...



Gracias a mi Dios ante todo!

Continue the discussion