first I open the table
Code: Select all
oRs = CREATEOBJECT( "ADODB.Recordset" )
TRY
oRS:Open( "SELECT * FROM Utenti", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=ecom.mdb", 1, 3 )
CATCH oErr
? oErr:Description
RETURN NIL
END TRY
Code: Select all
oApp():oGrid := TXBrowse():New( oApp():oDlg )
oApp():oGrid:nTop := 00
oApp():oGrid:nLeft := nSplit+2
oApp():oGrid:nBottom := ::nGridBottom
oApp():oGrid:nRight := ::nGridRight
aBrowse := { { { || STR( oRs:Fields( "ID" ):Value) }, i18n("Codice"), 150, 0 },;
{ { || oRs:Fields( "Nome" ):Value }, i18n("Nome"), 150, 0 },;
{ { || oRs:Fields( "Cognome" ):Value}, i18n("Cognome"), 150, 0 },;
{ { || oRs:Fields( "Via" ):Value} , i18n("Indirizzo"), 150, 0 } }
FOR i := 1 TO Len(aBrowse)
oCol := oApp():oGrid:AddCol()
oCol:bStrData := aBrowse[ i, 1 ]
oCol:cHeader := aBrowse[ i, 2 ]
oCol:nWidth := aBrowse[ i, 3 ]
oCol:nDataStrAlign := aBrowse[ i, 4 ]
oCol:nHeadStrAlign := aBrowse[ i, 4 ]
NEXT
oApp():oGrid:SetRDD()
oApp():oGrid:CreateFromCode()
it make error on this line
Code: Select all
oApp():oGrid:SetRDD()