ERROR -> DataRow Write Not Allowed for JOINED table's Columns

Post Reply
shri_fwh
Posts: 340
Joined: Mon Dec 07, 2009 2:49 pm

ERROR -> DataRow Write Not Allowed for JOINED table's Columns

Post by shri_fwh »

Dear Antonio ,

I am getting below error while editing TDataRow record's value in GET control. But the BASE table columns are allowed to write the values in GET control. Could you please let me know whether it is valied assign values to JOIN table's columns values as the values are copied to Array of TDataRow class. Please guide me.

Code: Select all | Expand

 csql := ;
 " SELECT t.* ," + ;
                                           " ts.tts_name " + ;
                                           " FROM vtm t " + ;
                                           " INNER JOIN vtts ts ON ts.cfy_id = t.cfy_id AND ts.tts_id = t.tts_id  WHERE t.tran_id = 1 " + ;
                                           
   oTMRs  := oApp:oDBConn:RowSet(csql )  
   oTMRow := TDataRow():New( oTMRs )
   oTMRow:Load(.T.)


   // ERROR GETTING AS tt_name belong other table    
   @   nGetRow,  130  SAY ":" GET aoGET[ 1 ] VAR oTMRow:tts_name SIZE 200, C_GETH PIXEL OF oWnd ;
    NOBORDER FONT oApp:oFontGet UPDATE


Code: Select all | Expand

Application
===========
   Path and name: D:\vimcosoft\V9ACC\v9acc.exe (32 bits)
   Size: 5,558,272 bytes
   Compiler version: Harbour 3.2.0dev (r2405310955)
   FiveWin  version: FWH 24.04
   C compiler version: Borland/Embarcadero C++ 7.7 (32-bit)
   Windows 11 64 Bits, version: 6.2, Build 9200 

   Time from start: 0 hours 0 mins 8 secs 
   Error occurred at: 14-09-2025, 20:28:46
   Error description: Error BASE/39  Write not allowed: TDATAROW:tts_name
   Args:
     [   1] = O   TDATAROW

Stack Calls
===========
   Called from: ../../../tobject.prg => __ERRRT_SBASE( 0 )
   Called from: ../../../tobject.prg => TDATAROW:ERROR( 0 )
   Called from: .\source\classes\datarow.prg => TDATAROW:FIELDPUT( 647 )
   Called from: .\source\classes\datarow.prg => TDATAROW:_TTS_NAME( 2563 )
   Called from: D:\vimcosoft\V9ACC\PRGS\txn_contra.prg => (b)TXNCONTRA( 32 )
   Called from: .\source\classes\tget.prg => (b)TGET( 326 )
   Called from: .\source\classes\tget.prg => TGET:VARPUT( 0 )
   Called from: .\source\classes\tget.prg => (b)TGET( 193 )
   Called from: .\source\classes\tget.prg => TGET:ASSIGN( 0 )
   Called from: .\source\classes\tget.prg => TGET:LOSTFOCUS( 2496 )
   Called from: .\source\classes\control.prg => TGET:KILLFOCUS( 1196 )
   Called from: .\source\classes\control.prg => TCONTROL:HANDLEEVENT( 1840 )
   Called from: .\source\classes\tget.prg => TGET:HANDLEEVENT( 1328 )
   Called from: .\source\classes\window.prg => _FWH( 3654 )
   Called from: .\source\classes\dialog.prg => DIALOGBOXINDIRECTW( 0 )
   Called from: .\source\classes\dialog.prg => TDIALOG:ACTIVATE( 309 )
   Called from: .\source\function\errsysw.prg => ERRORDIALOG( 448 )
   Called from: .\source\function\errsysw.prg => (b)ERRORSYS( 24 )

Thanks
Shridhar
FWH 24.04, BCC 7 32 bit, MariaDB
User avatar
Antonio Linares
Site Admin
Posts: 44515
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: ERROR -> DataRow Write Not Allowed for JOINED table's Columns

Post by Antonio Linares »

Please try this:

oTMRow:Load(.T.)
oTMRow:FieldReadOnly( "tts_name", .F. )
regards, saludos

Antonio Linares
www.fivetechsoft.com
vilian
Posts: 1068
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

Re: ERROR -> DataRow Write Not Allowed for JOINED table's Columns

Post by vilian »

In this case, With FWHMySql, you can create the datarow with EditBaseRecord.

oTMRow := oTMRs:EditBaseRecord(NIL,.T.)
Sds,
Vilian F. Arraes
[email protected]
Belém-Pa-Brazil
Post Reply