FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Abm con TDataBase ( Resuelto )
Posts: 1364
Joined: Wed Jun 21, 2006 12:39 AM
Abm con TDataBase ( Resuelto )
Posted: Fri Oct 21, 2022 12:25 AM
Colegas,
Estoy trabajando con esta clase pero no me doy cuenta como agregar ( append ) o modificar un registro. Este c贸digo no hace nada

Code (fw): Select all Collapse
//----------------------------------------------------------------------------//
Method Guardar() Class AbmComercio
//----------------------------------------------------------------------------//

聽 聽 Memvar o
聽 聽 
聽 聽 If( ::lOnOff )
聽 聽 聽 聽 o : oComercio : Append()
聽 聽 End聽
聽 聽 o : oComercio : codigo 聽 聽 := ::cCodigo 聽 聽 聽 聽 聽 聽 
聽 聽 o : oComercio : compartido := ::cCompartido 聽 聽 聽 聽 
聽 聽 o : oComercio : nombre 聽 聽 := ::cNombre 聽 聽 聽 聽 聽 聽 
聽 聽 o : oComercio : r_social 聽 := ::cR_social 聽 聽 聽 聽 聽 
聽 聽 o : oComercio : nrocuit 聽 聽:= ::cNrocuit 聽 聽 聽 聽 聽 聽
聽 聽 o : oComercio : respons 聽 聽:= ::cRespons 聽 聽 聽 聽 聽 聽
聽 聽 o : oComercio : domicilio 聽:= ::cDomicilio 聽 聽 聽 聽 聽
聽 聽 o : oComercio : puerta 聽 聽 := ::cPuerta 聽 聽 聽 聽 聽 聽 
聽 聽 o : oComercio : manzana 聽 聽:= ::cManzana 聽 聽 聽 聽 聽 聽
聽 聽 o : oComercio : barrio 聽 聽 := ::cBarrio 聽 聽 聽 聽 聽 聽 
聽 聽 o : oComercio : localidad 聽:= ::cLocalidad 聽 聽 聽 聽 聽
聽 聽 o : oComercio : c_p 聽 聽 聽 聽:= ::cC_p 聽 聽 聽 聽 聽 聽 聽 聽
聽 聽 o : oComercio : telefono 聽 := ::cTelefono 聽 聽 聽 聽 聽 
聽 聽 o : oComercio : celular 聽 聽:= ::cCelular 聽 聽 聽 聽 聽 聽
聽 聽 o : oComercio : rendicion 聽:= ::cRendicion 聽 聽 聽 聽 聽
聽 聽 o : oComercio : supervisor := ::cSupervisor 聽 聽 聽 聽 
聽 聽 o : oComercio : observac 聽 := ::cObservac 聽 聽 聽 聽 聽 
聽 聽 If( ::lOnOff )
聽 聽 聽 聽 o : oComercio : Save()
聽 聽 Else
聽 聽 聽 聽 o : oComercio : Updated()
聽 聽 End
聽 聽 Return 0


La variable ::lOnOff me indica si es un alta o una modificaci贸n. Que estoy haciendo mal? Muchas gracias!

Saludos
Posts: 1364
Joined: Wed Jun 21, 2006 12:39 AM
Re: Abm con TDataBase
Posted: Fri Oct 21, 2022 12:04 PM

+

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Abm con TDataBase ( Resuelto )
Posted: Fri Oct 21, 2022 04:53 PM

El objeto TDataBase es oComercio, si ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Abm con TDataBase ( Resuelto )
Posted: Fri Oct 21, 2022 05:04 PM
Modify current record

Code (fw): Select all Collapse
oDbf:<fieldname> := <newvalue>
....
oDbf:Save()


Append new record
Code (fw): Select all Collapse
oDbf:Blank()
oDbf:<fieldname> := <newvalue>
...
oDbf:Save()
Regards



G. N. Rao.

Hyderabad, India
Posts: 1364
Joined: Wed Jun 21, 2006 12:39 AM
Re: Abm con TDataBase ( Resuelto )
Posted: Fri Oct 21, 2022 10:27 PM

Gracias a ambos por contestar, efectivamente Antonio, ese es el objeto TDataBase. Use el m茅todo append() y funcion贸. Los m茅todos Blank() y Append() son equivalentes? El m茅todo Updated() que funci贸n cumple? Gracias nuevamente

Saludos

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Abm con TDataBase ( Resuelto )
Posted: Sat Oct 22, 2022 06:03 AM

Append a帽ade, Blank "limpia" el registro (lo vacia), Updated() devuelve verdadero o falso, seg煤n si la DBF ha sido actualizada

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1364
Joined: Wed Jun 21, 2006 12:39 AM
Re: Abm con TDataBase ( Resuelto )
Posted: Sat Oct 22, 2022 01:22 PM

Nuchas gracias Antonio por tu explicaci贸n.

Saludos

Continue the discussion