Page 2 of 2

Re: ORM power in next FWH

PostPosted: Tue Jul 30, 2019 8:13 pm
by Antonio Linares
Leandro,

Aqui falta una "e": LOWNCONN_CTION

Prueba a modificar source\classes\FWORM.PRG

a ver si con ese cambio te funciona

Re: ORM power in next FWH

PostPosted: Thu Aug 01, 2019 8:56 pm
by leandro
Antonio buenas tardes,

hice el cambio que recomendaste, pero ahora sale este error:

Code: Select all  Expand view
Application
===========
   Path and name: C:\dlyma\dlyma.exe (32 bits)
   Size: 6,175,232 bytes
   Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20190613)
   FiveWin  version: FWH 19.06
   C compiler version: Borland/Embarcadero C++ 7.3 (32-bit)
   Windows version: 6.2, Build 9200

   Time from start: 0 hours 0 mins 7 secs
   Error occurred at: 01/08/2019, 15:56:16
   Error description: Error BASE/1003  No existe la variable: PDOLPHINSRV

Stack Calls
===========
   Called from: c:\dlyma\prg\Fworm.prg => ORM_CONNECTION:NEW( 48 )
   Called from: c:\dlyma\prg\R32_fact.prg => R32_FACT( 31 )
   Called from: c:\dlyma\prg\Alyma.prg => (b)TLYMA:AUTORIZA( 1150 )
   Called from: c:\dlyma\prg\Alyma.prg => TLYMA:AUTORIZA( 1150 )
   Called from: c:\dlyma\prg\R32_menu.prg => (b)MAIN( 440 )
   Called from: .\source\classes\TRBTN.PRG => TRBTN:CLICK( 717 )
   Called from: .\source\classes\TRBTN.PRG => TRBTN:LBUTTONUP( 917 )
   Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1791 )
   Called from: .\source\classes\TRBTN.PRG => TRBTN:HANDLEEVENT( 1575 )
   Called from: .\source\classes\WINDOW.PRG => _FWH( 3546 )
   Called from:  => WINRUN( 0 )
   Called from: .\source\classes\WINDOW.PRG => TMDIFRAME:ACTIVATE( 1078 )
   Called from: c:\dlyma\prg\R32_menu.prg => MAIN( 529 )
 

Re: ORM power in next FWH

PostPosted: Fri Aug 02, 2019 4:25 am
by nageswaragunupudi
It is working correctly here.
You made a modification to the fworm.prg as advised by Mr. Antonio.
Please make sure you have this line of code in fworm.prg (line 11)
Code: Select all  Expand view
static pDolphinSrv, pClipValue2SQL
 


In our tests here we are not getting any errors.
This is our test:
Code: Select all  Expand view
#include "fivewin.ch"

function Main()

   local oServer
   local orm, oStates

   oServer  := FW_DemoDB( "DLP" ) // Dolphin connection
   orm      := ORM_Connection():New( oServer )
   oStates  := orm:Table( "states" )
   oStates:Browse()

   oServer:End()

return nil

EXTERNAL TDOLPHINSRV
 

Re: ORM power in next FWH

PostPosted: Fri Aug 02, 2019 6:03 am
by Otto
Dear Mr. Rao,
can we use this ORM power to update remote DBF files?
Thank you in advance
Otto

Re: ORM power in next FWH

PostPosted: Fri Aug 02, 2019 3:28 pm
by leandro
Mr Nages.

La línea 11 esta en donde debe estar.

Code: Select all  Expand view

#include "fivewin.ch"

#define REVD

#define LIB_ADO   1
#define LIB_FWH   2
#define LIB_DLP   4

#xtranslate XTRIM( <u> ) => If( HB_ISCHAR( <u> ), Trim( <u> ), <u> )

static pDolphinSrv, pClipValue2SQL
static cAggrFuncList := ",AVG,COUNT,SUM,STD,STDEV,MAX,MIN,GROUP_CONCAT,VARIANCE,"

//----------------------------------------------------------------------------//

CLASS ORM_Connection

   DATA   cServer
   DATA   cDataBase
   DATA   cUserName
   DATA   oCn

   DATA   nLib     INIT 0
   DATA   rdbms    INIT "MYSQL"

   DATA   lOwnConnection INIT .t.
   DATA   lOwnConnction //agrega la data que menciono Antonio

   METHOD New( cServer, cDataBase, cUserName, cPassword )
   METHOD Connect( cPassWord )
   METHOD Tables()
   METHOD HasTable( cTable ) INLINE ::Tables():Contain( cTable )
   METHOD Table( cTableName )
   METHOD Close() INLINE If( ::oCn == nil .or. !::lOwnConnection,,;
            ( If( ::nLib == LIB_DLP, ::oCn:End(), ::oCn:Close() ), ::oCn := nil ) )

   ERROR HANDLER OnError( uParam1 )

ENDCLASS