Page 1 of 1

MariaRowSet Field ERROR in TGET READONLY Control

Posted: Sun Dec 29, 2019 7:31 am
by shri_fwh
Dear Rao Sir ,

Have TGET control in DIALOG window and it has READYONLY attribute and the TGET reads data from a Mariarowset:column.

When TGET control gets cursor and throws an error as given below

Code: Select all

@40, 020  SAY  "Ledger"   SIZE 80, C_SAYH PIXEL COLOR C_SAYFCLR, C_SAYBCLR FONT oApp:oFontSay TRANSPARENT
   @40, 100  GET aoGET[ 1 ] VAR oAcLedRs:ACCT_NAME SIZE 400, C_GETH PIXEL OF oWnd READONLY FONT oApp:oFontGet UPDATE
   @70, 020  SAY  "Group"   SIZE 80, C_SAYH PIXEL COLOR C_SAYFCLR, C_SAYBCLR FONT oApp:oFontSay TRANSPARENT
   @70, 100  GET aoGET[ 2 ] VAR oAcLedRs:AGRP_NAME SIZE 400, C_GETH PIXEL OF oWnd READONLY FONT oApp:oFontGet UPDATE

 

Code: Select all


Application
===========
   Path and name: C:\VIMDEV32\VIMFA32\vimfa.exe (32 bits)
   Size: 7,937,024 bytes
   Compiler version: Harbour 3.2.0dev (r1904111533)
   FiveWin  version: FWH 19.12
   C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
   Windows version: 6.1, Build 7601 Service Pack 1

   Time from start: 0 hours 2 mins 11 secs 
   Error occurred at: 28/12/2019, 20:04:04
   Error description: Error BASE/39  Write not allowed: va02:CL_BAL
   Args:
     [   1] = O   FWMARIAROWSET

Stack Calls
===========
   Called from:  => __ERRRT_SBASE( 0 )
   Called from: ../../../tobject.prg => FWMARIAROWSET:ERROR( 0 )
   Called from: .\source\internal\FWMARIA.PRG => FWMARIAROWSET:FIELDPUT( 2481 )

 

Re: MariaRowSet Field ERROR in TGET READONLY Control

Posted: Sun Dec 29, 2019 4:59 pm
by nageswaragunupudi
Please check if you made the GET of oRs:CL_BAL as READONLY or not.

Re: MariaRowSet Field ERROR in TGET READONLY Control

Posted: Mon Dec 30, 2019 11:20 am
by shri_fwh
Dear Rao Sir ,

Both TGET control and RowSet are in READONLY mode but, still it has error.

ROWSET

Code: Select all


   oPrdInfoRs:lReadOnly := .T.

 
TGET

Code: Select all

 @070, 870  GET aoGET[ 8 ] VAR oPrdInfoRs:OP_BAL_QTY SIZE 120, C_GETH PIXEL PICTURE "@Z 99,99,99,99,999" RIGHT OF oWnd READONLY FONT oApp:oFontGet UPDATE
 

Re: MariaRowSet Field ERROR in TGET READONLY Control

Posted: Tue Dec 31, 2019 3:17 am
by nageswaragunupudi
Please make the following 2 modifications in \fwh\source\classes\tget.prg.

METHOD lValid()
Present code:

Code: Select all

METHOD lValid() CLASS TGet

   local lRet := .t.

   if ::oGet:BadDate
 
Modify as:

Code: Select all

METHOD lValid() CLASS TGet

   local lRet := .t.

   if ::lReadOnly
      return lRet
   endif

   if ::oGet:BadDate
 
METHOD LostFocus()

Present code:

Code: Select all

METHOD LostFocus( hCtlFocus ) CLASS TGet

   ::Super:LostFocus( hCtlFocus )

#ifdef UTFREVN
 
Modify as:

Code: Select all

METHOD LostFocus( hCtlFocus ) CLASS TGet

   ::Super:LostFocus( hCtlFocus )

   if ::lReadOnly
      return nil
   endif

#ifdef UTFREVN
 

Re: MariaRowSet Field ERROR in TGET READONLY Control

Posted: Tue Dec 31, 2019 10:13 am
by nageswaragunupudi
This problem is not unique to Mariadb Rowsets but applies to all readonly datasources.
Here is an example with DBF opened READONLY.

Code: Select all

#include "fivewin.ch"

REQUEST DBFCDX

function Main()

   local oDlg, oGet

   USE CUSTOMER READONLY VIA "DBFCDX"

   DEFINE DIALOG oDlg SIZE 300,200 PIXEL TRUEPIXEL

   @  20,40 GET oGet VAR FIELD->ID     PICTURE "9999"    SIZE 150,30 PIXEL OF oDlg READONLY

   @  60,40 GET oGet VAR FIELD->SALARY PICTURE "999,999" SIZE 150,30 PIXEL OF oDlg READONLY

   @ 100,40 BUTTON "OK" SIZE 100,40 PIXEL OF oDlg

   ACTIVATE DIALOG oDlg CENTERED

return nil
 

Re: MariaRowSet Field ERROR in TGET READONLY Control

Posted: Tue Dec 31, 2019 11:53 am
by shri_fwh
Dear Rao Sir ,

Changed as per your suggestion now its working..! Thanks a lot...!

Re: MariaRowSet Field ERROR in TGET READONLY Control

Posted: Thu Jan 02, 2020 3:28 pm
by nageswaragunupudi
The fix is incorporated in FWH2001