strange problem with tdatabase
Posted: Sat Aug 10, 2019 10:37 am
I must erase all record of an invoice number ( the filed is 13cr)
Local nInvoice := "1234567890128"
the oPartres dbf is index on INDEX ON RESITEMS->INVNUM + STR( SERIAL, 3, 0 ) TAG invnum TO resitems
oPartres:=TDatabase():Open( , cDir+"ResItems", "DBFCDX", .T. )
oPartres:setorder(1)
oPartres:gotop()
oPartRes:Gotop()
Do While .not. oPartRes:eof()
IF alltrim(oPartRes:InvNum) == alltrim(nInvoice)
// Msginfo( oPartRes:InvNum ,nInvoice)
oPartRes:delete()
Endif
oPartRes:skip()
EndDo
oPartRes:Gotop()
SET DELETED ON
oPartRes:SetOrder( 0 )
oPartRes:GoTo( 1 )
oPartRes:ArrayToDBF( aItems, cItemFlds, nil, .t., .t. )
it save goog but erased all records
I wish save on dbf with the condition alltrim(oPartRes:InvNum) == alltrim(nInvoice
Any solution please ...
Local nInvoice := "1234567890128"
the oPartres dbf is index on INDEX ON RESITEMS->INVNUM + STR( SERIAL, 3, 0 ) TAG invnum TO resitems
oPartres:=TDatabase():Open( , cDir+"ResItems", "DBFCDX", .T. )
oPartres:setorder(1)
oPartres:gotop()
oPartRes:Gotop()
Do While .not. oPartRes:eof()
IF alltrim(oPartRes:InvNum) == alltrim(nInvoice)
// Msginfo( oPartRes:InvNum ,nInvoice)
oPartRes:delete()
Endif
oPartRes:skip()
EndDo
oPartRes:Gotop()
SET DELETED ON
oPartRes:SetOrder( 0 )
oPartRes:GoTo( 1 )
oPartRes:ArrayToDBF( aItems, cItemFlds, nil, .t., .t. )
it save goog but erased all records
I wish save on dbf with the condition alltrim(oPartRes:InvNum) == alltrim(nInvoice
Any solution please ...