method add, del in DBCOMBO

method add, del in DBCOMBO

Postby kajot » Tue Dec 20, 2016 9:24 pm

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

maybe an example
best regards
kajot
User avatar
kajot
 
Posts: 339
Joined: Thu Nov 02, 2006 6:53 pm
Location: Poland

Re: method add, del in DBCOMBO

Postby James Bott » Fri Mar 03, 2017 5: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: method add, del in DBCOMBO

Postby joseluisysturiz » Fri Mar 03, 2017 7:55 pm

Saludos, yo lo hago asi, espero te ayude...saludos... :shock:

Code: Select all  Expand view

// 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!
User avatar
joseluisysturiz
 
Posts: 2064
Joined: Fri Jan 06, 2006 9:28 pm
Location: Guatire - Caracas - Venezuela


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 93 guests