I am trying to add a new record:
- Code: Select all Expand view
- #include "fivewin.ch"
#include "dbinfo.ch"
#include "adodef.ch"
#include "xbrowse.ch"
#include "Set.ch"
REQUEST HB_Lang_ES
REQUEST HB_CODEPAGE_ESWIN
FUNCTION MAIN()
local cStr, oCn, oRs
local oData
// Idioma español
HB_LangSelect("ES") // Para mensajes, fechas, etc..
HB_CDPSELECT("ESWIN") // Para ordenación, requiere CodePage.lib
// Driver CDX----------------------------------------------------------------
REQUEST DBFCDX, DBFFPT
RDDSETDEFAULT( "DBFCDX")
SET DATE TO ITALIAN
SET EPOCH TO 1990
cStr := "Driver={MySQL ODBC 3.51 Driver};Server=db4free.net;" + ;
"Database=pruebasado;User=pruebasado;Password=123456;Option=3;"
oCn := FW_OpenAdoConnection( cStr )
oRs := FW_OpenRecordSet( oCn, "select * from clientes" )
if oRs = nil
msgstop("error opening recordset")
oCn:Close()
RETURN NIL
endif
xbrowser oRs
oData := TDataRow():New( oRs, nil, .T. )
oData:registro := 1
oData:nombre := "Cliente añadido por Lucas3"
oData:email := "mi email"
MsgInfo(oData:Modified(), "IsModified")
oData:Save()
xbrowser oRs
oCn:Close()
QUIT
RETURN NIL
//----------------------------------------------------------------------------//
This is the error:
Application
===========
Path and name: C:\ADO\DATAROW.exe (32 bits)
Size: 2,876,928 bytes
Compiler version: Harbour 3.2.0dev (Rev. 18881)
FiveWin Version: FWH 13.05
Windows version: 6.1, Build 7601 Service Pack 1
Time from start: 0 hours 0 mins 5 secs
Error occurred at: 09-06-13, 12:05:44
Error description: Error BASE/1004 Message not found: TDATAROW:ADDNEW
Stack Calls
===========
Called from: .\source\function\HARBOUR.PRG => _CLSSETERROR( 234 )
Called from: .\source\classes\DATAROW.PRG => TDATAROW:ADDNEW( 543 )
Called from: .\source\classes\DATAROW.PRG => TDATAROW:SAVEADO( 355 )
Called from: .\source\classes\DATAROW.PRG => TDATAROW:SAVE( 279 )
Called from: datarow.prg => MAIN( 79 )
Thank you.
What is the problem?.