I have a xBrowse
I need switching Recordset dynamically ,and the table and fields of the recordset are not identical.
I solved in this way
Open new Recset oNewRs
FOR i := len(oBrwLis:aCols) to 1 STEP - 1
oBrw:DelCol(i)
NEXT
oBrw:SetADO( oNewRs )
oRsOld:Close()
oBrw:GoTop()
oBrw:Refresh()
Is correct use oBrw:SetADO( oNewRs ) or can cause side effects ?
I have another question
In the xBrowse I have logical columns : COL_1 , COL_2,...
I do not understand why this works
- Code: Select all Expand view
- FOR nX := 1 TO len(oBrw:aCols)
WITH OBJECT oBrw:aCols[nX]
:SetCheck()
:bStrData := { || "" }
IF :cExpr == "COL_1"
:bEditValue := { || IF( oBrw:oRs:Fields("COL_1" ) :Value == -1 ,.T.,.F.) }
ENDIF
IF :cExpr == "COL_2"
:bEditValue := { || IF( oBrw:oRs:Fields("COL_2" ) :Value == -1 ,.T.,.F.) }
ENDIF
END
NEXT
and this dosn't work
- Code: Select all Expand view
- FOR nX := 1 TO len(oBrw:aCols)
WITH OBJECT oBrw:aCols[nX]
:SetCheck()
:bStrData := { || "" }
:bEditValue := { || IF( oBrw:oRs:Fields(:cExpr) :Value == -1 ,.T.,.F.) }
END
NEXT
Thanks in anticipation
Maurizio
http://www.nipeservice.com