MariaRowSet Field ERROR in TGET READONLY Control

MariaRowSet Field ERROR in TGET READONLY Control

Postby shri_fwh » Sun Dec 29, 2019 7:31 am

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  Expand view  RUN

@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  Expand view  RUN


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 )

 
Thanks
Shridhar
FWH 19.12, BCC 7 32 bit, MariaDB
shri_fwh
 
Posts: 301
Joined: Mon Dec 07, 2009 2:49 pm

Re: MariaRowSet Field ERROR in TGET READONLY Control

Postby nageswaragunupudi » Sun Dec 29, 2019 4:59 pm

Please check if you made the GET of oRs:CL_BAL as READONLY or not.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10690
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: MariaRowSet Field ERROR in TGET READONLY Control

Postby shri_fwh » Mon Dec 30, 2019 11:20 am

Dear Rao Sir ,

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

ROWSET
Code: Select all  Expand view  RUN


   oPrdInfoRs:lReadOnly := .T.

 


TGET
Code: Select all  Expand view  RUN

 @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
 
Thanks
Shridhar
FWH 19.12, BCC 7 32 bit, MariaDB
shri_fwh
 
Posts: 301
Joined: Mon Dec 07, 2009 2:49 pm

Re: MariaRowSet Field ERROR in TGET READONLY Control

Postby nageswaragunupudi » Tue Dec 31, 2019 3:17 am

Please make the following 2 modifications in \fwh\source\classes\tget.prg.

METHOD lValid()
Present code:
Code: Select all  Expand view  RUN
METHOD lValid() CLASS TGet

   local lRet := .t.

   if ::oGet:BadDate
 


Modify as:
Code: Select all  Expand view  RUN
METHOD lValid() CLASS TGet

   local lRet := .t.

   if ::lReadOnly
      return lRet
   endif

   if ::oGet:BadDate
 


METHOD LostFocus()

Present code:
Code: Select all  Expand view  RUN
METHOD LostFocus( hCtlFocus ) CLASS TGet

   ::Super:LostFocus( hCtlFocus )

#ifdef UTFREVN
 


Modify as:
Code: Select all  Expand view  RUN

METHOD LostFocus( hCtlFocus ) CLASS TGet

   ::Super:LostFocus( hCtlFocus )

   if ::lReadOnly
      return nil
   endif

#ifdef UTFREVN
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10690
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: MariaRowSet Field ERROR in TGET READONLY Control

Postby nageswaragunupudi » Tue Dec 31, 2019 10:13 am

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  Expand view  RUN
#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
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10690
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: MariaRowSet Field ERROR in TGET READONLY Control

Postby shri_fwh » Tue Dec 31, 2019 11:53 am

Dear Rao Sir ,

Changed as per your suggestion now its working..! Thanks a lot...!
Thanks
Shridhar
FWH 19.12, BCC 7 32 bit, MariaDB
shri_fwh
 
Posts: 301
Joined: Mon Dec 07, 2009 2:49 pm

Re: MariaRowSet Field ERROR in TGET READONLY Control

Postby nageswaragunupudi » Thu Jan 02, 2020 3:28 pm

The fix is incorporated in FWH2001
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10690
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 92 guests