Page 1 of 1
Dolphin to FW MySql/Maria upgrade (Solved) ...
Posted: Mon Jun 15, 2020 2:31 pm
by bosibila
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
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
Re: Dolphin to FW MySql/Maria upgrade ...
Posted: Mon Jun 15, 2020 4:18 pm
by carlos vargas
both harbor and xharbour allow the modification of methods and datas of a class.
examples:
Code: Select all
/*-------------------------------------------------------------------------------------------------*/
#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
...
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.
Re: Dolphin to FW MySql/Maria upgrade ...
Posted: Mon Jun 15, 2020 5:37 pm
by nageswaragunupudi
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
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
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.
Re: Dolphin to FW MySql/Maria upgrade (Solved)...
Posted: Mon Jun 15, 2020 5:48 pm
by bosibila
Thanks mr. Rao,
your solution is acceptable to me. Tested, works OK ...
Re: Dolphin to FW MySql/Maria upgrade (Solved)...
Posted: Tue Jun 16, 2020 12:37 am
by nageswaragunupudi
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.
Re: Dolphin to FW MySql/Maria upgrade (Solved) ...
Posted: Tue Jun 16, 2020 7:04 pm
by bosibila
My version is 20.04 ...
Re: Dolphin to FW MySql/Maria upgrade (Solved) ...
Posted: Tue Jun 16, 2020 7:48 pm
by nageswaragunupudi
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.