- Code: Select all Expand view
aData := oQry:GetRows()
oPed := TArrayData():New( Aclone(aData), oQry:aStructure )
DO WHILE .NOT. oPed:Eof()
oPed:Skip()
ENDDO
But oPed:Eof() never is returning .T.
Do you know why ?
aData := oQry:GetRows()
oPed := TArrayData():New( Aclone(aData), oQry:aStructure )
DO WHILE .NOT. oPed:Eof()
oPed:Skip()
ENDDO
do while oPed:nAt < oPen:KeyCount()
<do your work>
oPed:Skip( 1 )
enddo
nReg := 0
do while nReg < oPen:KeyCount()
<do your work>
nReg++
oPed:Skip( 1 )
enddo
do while .t.
<do your work>
if oPed:nAt < oPed:KeyCount()
oPed:Skip( 1 )
else
EXIT
endif
enddo
cSql :="Select id, tc, concep, valdeb, descue, valcre,detalle,vence from unicuota where tc='CM' and matric="+ClipValue2Sql( mmm:matric )
oRs := oCn:RowSet( cSql )
aData := oRs:GetRows()
oRs2:= TArrayData():New( AClone(aData) , oRs:aStructure )
oRs2:GOtop()
While .t. // !oRs2:Eof() Commented because don't return .t. and while don't stop
cSql2:=cSql2+"update unicuota set valdeb="+ClipValue2Sql( oRs2:valdeb )+",descue="+ClipValue2Sql( oRs2:descue )+" where id="+ ClipValue2Sql( oRs2:id )+";"+CRLF
if oRs2:nAt = oRs2:KeyCount() // Temporal solution to exit while at end
EXIT
Else
oRs2:Skip(1)
Endif
End
oData:Eval( { |Self| ::state := "NY" } )
#include "fivewin.ch"
function Main()
local oCn, oData, oRs
oCn := FW_DemoDB()
oData := TArrayData():New( oCn, "SELECT id, first, state, age from customer WHERE state = 'NY'" )
// Edit/Modify/Delete/Append
XBROWSER oData FASTEDIT
if MsgYesNo( "Save Changes?" )
oData:SaveData()
? "Changes saved"
else
? "Changes ignored"
endif
// Check the changes
oRs := oCn:RowSet( "SELECT id, first, state, age from customer WHERE state = 'NY'" )
XBROWSER oRs
return nil
oData := TArrayData():New( oCn, cTableName, [cWhere] )
//OR
oData := TArrayData():New( oCn, cSql, [aParams] )
:New( aData, [aStruct] ) // for simple arrays
:New( [cAlias], [bFor], [bWhile], [nNext], [nRec], [lRest] ) // DBF
:New( oCn, cTable, cWhere ) // MariaDb connection object for MySql
:New( oCn, cSql, [aParams] )
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: russimicro and 45 guests