Dolphin to FW MySql/Maria upgrade (Solved) ...

Dolphin to FW MySql/Maria upgrade (Solved) ...

Postby bosibila » Mon Jun 15, 2020 2:31 pm

Hello,
I am finishing upgrade from tDolphin to FW MySql/Maria and have one question. Is it some methods to replace this tDolphin code to FW MySql/Maria?

Code: Select all  Expand view
oQry := oServer:Query( "CHECK TABLE customer" )
? oQry:lastrec(), oQry:msg_type, oQry:msg_text
oQry:end()
 


This code code produce error:
Error description: Error BASE/1004 Class: 'NIL' has no exported method: LASTREC
Last edited by bosibila on Mon Jun 15, 2020 5:50 pm, edited 1 time in total.
Boris (FWH 20.07, xHarbour 1.2.3, Harbour 3.2.0, BCC74, MySql 5.7)
User avatar
bosibila
 
Posts: 53
Joined: Wed Aug 06, 2008 5:27 pm
Location: Osijek, Croatia

Re: Dolphin to FW MySql/Maria upgrade ...

Postby carlos vargas » Mon Jun 15, 2020 4:18 pm

both harbor and xharbour allow the modification of methods and datas of a class.

examples:
Code: Select all  Expand view

/*-------------------------------------------------------------------------------------------------*/

#include "hbclass.ch"

/*-------------------------------------------------------------------------------------------------*/

PROCEDURE OverrideAndExtend()

   EXTEND CLASS TCONTROL WITH METHOD MyDisable
...
...
   OVERRIDE METHOD GETDLGCODE IN CLASS TBUTTON     WITH KGETDLGCODE

RETURN
/*-------------------------------------------------------------------------------------------------*/

FUNCTION MyDisable( aCtrlType )
   LOCAL Self := hb_QSelf()

   IF ( ::ClassName() IN aCtrlType )
      ::bWhen := NIL
      ::Disable()
   ENDIF

RETURN NIL
/*-------------------------------------------------------------------------------------------------*/

FUNCTION KGetDlgCode( nLastKey )
   LOCAL Self := hb_QSelf()

   ::oWnd:nLastKey := nLastKey

   DO CASE
   CASE !hb_isNil( ::oWnd:oWnd ) .and. ( ::oWnd:oWnd:IsKindOf( "TFOLDER" ) .or. ::oWnd:oWnd:IsKindOf( "TFOLDEREX" ) )
      RETURN DLGC_WANTALLKEYS
   CASE nLastKey == VK_ESCAPE .and. !hb_isNil( ::oWnd:oWnd ) .and. ( ::oWnd:oWnd:IsKindOf( "TWINDOW"   ) .and. ::oWnd:IsKindOf( "TDIALOG" ) )
      RETURN DLGC_WANTALLKEYS
   ENDCASE

RETURN NIL
 


for example for add the method lastrec

Code: Select all  Expand view

...
  EXTEND CLASS FWMARIACONNECTION WITH METHOD lastrec
...
FUNCTION Lastrec()
   LOCAL Self := hb_QSelf()
RETURN ::RecCount
..
 


This is an example, I don't remember the name of the native class for mariadb or mysql handling in fivewin.

note:
reviewing the info of fivewin I see that lastrec exists, so I see in the error the variable oQry has a value of nil, so it means that the query failed
oQry := oServer:Query( "CHECK TABLE customer" )
if !hb_nil(oQry)
? oQry:lastrec(), oQry:msg_type, oQry:msg_text
oQry:end()
else
?"Error in query."
endif


You can verify the name of the table, remember that if your server is linux, it is most likely that the names of tables and fields are case sensitive.
Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)
User avatar
carlos vargas
 
Posts: 1720
Joined: Tue Oct 11, 2005 5:01 pm
Location: Nicaragua

Re: Dolphin to FW MySql/Maria upgrade ...

Postby nageswaragunupudi » Mon Jun 15, 2020 5:37 pm

bosibila wrote:Hello,
I am finishing upgrade from tDolphin to FW MySql/Maria and have one question. Is it some methods to replace this tDolphin code to FW MySql/Maria?

Code: Select all  Expand view
oQry := oServer:Query( "CHECK TABLE customer" )
? oQry:lastrec(), oQry:msg_type, oQry:msg_text
oQry:end()
 


This code code produce error:
Error description: Error BASE/1004 Class: 'NIL' has no exported method: LASTREC


Your query should work, but it fails and that is a bug in our library in respect of SQL statements starting with "CHECK "
We will fix this in this version.
Till then we request you to use this workaround.

Code: Select all  Expand view

aResult := oCn:Execute( "CHECK TABLE customer" )  // returns array of the same rows as in a query result
XBROWSER aResult
 


Thanks for pointing out.
We appreciate for bringing out any other issues that you may come across while migrating.

Notes:
METHODS Query() and RowSet() are synonimous.
Same sql statement when executed with oCn:Execute() returns results as an array.

Please also indicate the version of FWH you are using.
Regards

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

Re: Dolphin to FW MySql/Maria upgrade (Solved)...

Postby bosibila » Mon Jun 15, 2020 5:48 pm

Thanks mr. Rao,
your solution is acceptable to me. Tested, works OK ...
Boris (FWH 20.07, xHarbour 1.2.3, Harbour 3.2.0, BCC74, MySql 5.7)
User avatar
bosibila
 
Posts: 53
Joined: Wed Aug 06, 2008 5:27 pm
Location: Osijek, Croatia

Re: Dolphin to FW MySql/Maria upgrade (Solved)...

Postby nageswaragunupudi » Tue Jun 16, 2020 12:37 am

bosibila wrote:Thanks mr. Rao,
your solution is acceptable to me. Tested, works OK ...


Please let me know the version of FWH you are using.
Regards

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

Re: Dolphin to FW MySql/Maria upgrade (Solved) ...

Postby bosibila » Tue Jun 16, 2020 7:04 pm

My version is 20.04 ...
Boris (FWH 20.07, xHarbour 1.2.3, Harbour 3.2.0, BCC74, MySql 5.7)
User avatar
bosibila
 
Posts: 53
Joined: Wed Aug 06, 2008 5:27 pm
Location: Osijek, Croatia

Re: Dolphin to FW MySql/Maria upgrade (Solved) ...

Postby nageswaragunupudi » Tue Jun 16, 2020 7:48 pm

This issue is fixed in version FWH 2006.
If you send an email to nageswaragunupudi [at] gmail [dot] com, we can provide the revised libraries (borland 32bit) so that you need not change your source code for this reason alone.
Regards

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 78 guests