Code: Select all
aData := oQry:GetRows()
oPed := TArrayData():New( Aclone(aData), oQry:aStructure )
DO WHILE .NOT. oPed:Eof()
oPed:Skip()
ENDDO
Do you know why ?
Code: Select all
aData := oQry:GetRows()
oPed := TArrayData():New( Aclone(aData), oQry:aStructure )
DO WHILE .NOT. oPed:Eof()
oPed:Skip()
ENDDO
Code: Select all
do while oPed:nAt < oPen:KeyCount()
<do your work>
oPed:Skip( 1 )
enddo
Code: Select all
nReg := 0
do while nReg < oPen:KeyCount()
<do your work>
nReg++
oPed:Skip( 1 )
enddo
Code: Select all
do while .t.
<do your work>
if oPed:nAt < oPed:KeyCount()
oPed:Skip( 1 )
else
EXIT
endif
enddo
Code: Select all
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
Code: Select all
oData:Eval( { |Self| ::state := "NY" } )
Code: Select all
#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
Code: Select all
oData := TArrayData():New( oCn, cTableName, [cWhere] )
//OR
oData := TArrayData():New( oCn, cSql, [aParams] )
Code: Select all
: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] )