With this simple, I can´t append records, the xBrowse at Edit() does not allow to change values:
- Code: Select all Expand view
- #include "fivewin.ch"
#include "xbrowse.ch"
#include "dbstruct.ch"
#include "adodef.ch"
REQUEST DBFCDX
//----------------------------------------------------------------------------//
function Main()
local oCn
local nChoice, uDataSource
SET DATE ITALIAN
SET CENTURY ON
SET DELETED ON
FWNumFormat( "A", .t. )
oCn := FW_OpenAdoConnection( "ACCESS.mdb" )
uDataSource := FW_OpenRecordSet( oCn, "CUENTAS" )
BrowseData( uDataSource )
uDataSource:Close()
if oCn != nil
oCn:Close()
endif
return nil
//----------------------------------------------------------------------------//
// TESTING XBROWSE WITH TDATAROW
// Both XBrowse and TDataRow Code is the same for all Data Sources
//----------------------------------------------------------------------------//
static function BrowseData( uData )
local oDlg, oBrw, oFont, oRec
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
DEFINE DIALOG oDlg SIZE 900,400 PIXEL FONT oFont ;
TITLE "TDataRow test : " + FWVERSION
@ 30,10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg ;
DATASOURCE uData AUTOCOLS AUTOSORT ;
FOOTERS CELL LINES NOBORDER
WITH OBJECT oBrw
//
:CreateFromCode()
END
@ 10,10 BUTTON "Edit" SIZE 40,12 PIXEL OF oDlg ;
ACTION ( oRec := TDataRow():New( uData ), oRec:Edit(), oBrw:Refresh(), oBrw:SetFocus() )
@ 10,60 BUTTON "Append" SIZE 40,12 PIXEL OF oDlg ;
ACTION ( oRec := TDataRow():New( uData, nil, .t. ), oRec:Edit(), oBrw:Refresh(), oBrw:SetFocus() )
ACTIVATE DIALOG oDlg CENTERED
RELEASE FONT oFont
return nil
//----------------------------------------------------------------------------//
And Access.mdb:
http://rapidgator.net/file/3435501255cc ... S.MDB.html
Thank you. Best regards