Page 22 of 70

Re: ADO RDD xHarbour

PostPosted: Mon Apr 06, 2015 4:25 pm
by Antonio Linares
Antonio,

I don't understand this line:

dbgoto(nrecno) = adordd - oSet:Bookmark := nrecno


Could you please explain it ? thanks

Re: ADO RDD xHarbour

PostPosted: Mon Apr 06, 2015 4:32 pm
by AHF
Lucas,

DbSeek only supports searching into 1 field.


Can you post the code example and index used? Here seeks more 1 field.

But the real problem is that data is not saved!!!. When the program is closed, they are lost!.


To us the most important and difficult features are:

1) To have all indexes, record movement, seek, locates and relations emulating 100% ISAM as dbf and ADS.

2) Concurrent access with Transactions.

I dont foresee problems in other features but still not initiated.

As I told you I'm not looking yet for field replaces ,writes etc.
It should work but I really can not tell.

Last version its in trial with transactions!
Please check if your version already has transactions. In this case transactions only be flushed with dbcommit.
We are trying beginstrans with the first lock and committrans with dbcommit or rollbacktrans with ADOBEGINTRANS(nArea).

Could you please try it?

Re: ADO RDD xHarbour

PostPosted: Mon Apr 06, 2015 4:41 pm
by AHF
Antonio,

Antonio Linares wrote:Antonio,

I don't understand this line:

dbgoto(nrecno) = adordd - oSet:Bookmark := nrecno


Could you please explain it ? thanks


Example:
Code: Select all  Expand view

nRec := recno()  // value of bookmark in adordd returned 2.00
....
dbgoto(nRec) // value in ado_gotoid() 2 ors:BookMark := nRec you get a bookmark error!
 


This means that the value returned from recno() its correct.
Then when passing it to dbgoto() it gets to ado_gotoid() in adordd incorrect.
Bookmark does not assure any specific datatype because it depends on the provider.

Re: ADO RDD xHarbour

PostPosted: Mon Apr 06, 2015 8:24 pm
by AHF
Lucas,

New version adordd -trial alternative seeks https://github.com/AHFERREIRA/adordd.git

ready : auto open, auto order, relations, record movements (go to, recno, eof, etc), locate and continue, seeks.

Search for "experimental phase" in the code to understand what I m trying to do.

Can you try relations and seeks with a medium size table (> 100.000 records) (both parent and child) on a browse to check performance?

Transactions are automatically called so please dont forget to issue dbcommit after each transaction or data wont be saved.
In this trial transacts are initiated in the first lock and ended in the first dbcommit.

Thanks

Re: ADO RDD xHarbour

PostPosted: Tue Apr 07, 2015 7:33 am
by AHF
Lucas,

Is APPEND BLANK working ?

Re: ADO RDD xHarbour

PostPosted: Tue Apr 07, 2015 9:01 am
by AHF
Antonio,

Please send me addfef.ch.

Thanks

Re: ADO RDD xHarbour

PostPosted: Tue Apr 07, 2015 9:13 am
by AHF
Antonio,

Can you check what function is calling UR_EXISTS ?

Re: ADO RDD xHarbour

PostPosted: Tue Apr 07, 2015 9:24 am
by Antonio Linares
AHF wrote:Antonio,

Please send me addfef.ch.

Thanks


Where is such file ? I can't find it in Harbour files neither in FWH ones.

Re: ADO RDD xHarbour

PostPosted: Tue Apr 07, 2015 9:40 am
by Antonio Linares
Antonio,

AHF wrote:Antonio,

Can you check what function is calling UR_EXISTS ?


In adordd.prg there is:

aADOFunc[ UR_EXISTS ] := @ADO_EXISTS()

Re: ADO RDD xHarbour

PostPosted: Tue Apr 07, 2015 9:51 am
by AHF
Antonio,

Where is such file ? I can't find it in Harbour files neither in FWH ones.


Its mentioned in adofuncs.prg

In adordd.prg there is:

aADOFunc[ UR_EXISTS ] := @ADO_EXISTS()


I meant what is the function calling UR_EXISTS ?

Re: ADO RDD xHarbour

PostPosted: Tue Apr 07, 2015 11:00 am
by AHF
Antonio,

What are these function for?

/* non WorkArea functions */

#define UR_EXIT 95
#define UR_DROP 96
#define UR_EXISTS 97
#define UR_RENAME 98

Re: ADO RDD xHarbour

PostPosted: Tue Apr 07, 2015 11:13 am
by AHF
Antonio,

adordd its almost finished and all "light" trials seem to be ok Not one line code changed!:D

adordd its prepared to work the dbseek with selects or :find and the final decision will depend on performance.
It might compensates the trade off between no code change and speed. We will see.

Now I'm missing information asked in my previous posts.

I'm finishing:

APPEND FROM and COPY TO to be parse into sql (INSERT INTO ... SELECT FROM.... ) but shouldn't be a problem.

I'm sure that many bugs will be found but we are getting there. :D

Re: ADO RDD xHarbour

PostPosted: Tue Apr 07, 2015 1:46 pm
by Antonio Linares
Antonio,

UR_EXIT seems as an EXIT procedure where we can do cleaning if needed.

Regarding the others, dbcmd.c uses them this way:
Code: Select all  Expand view
HB_FUNC( HB_DBDROP )
{
   LPRDDNODE  pRDDNode;
   HB_USHORT  uiRddID;
   HB_ULONG   ulConnection;
   const char * szDriver;
   PHB_ITEM   pName;

   szDriver = hb_parc( 3 );
   if( ! szDriver ) /* no VIA RDD parameter, use default */
   {
      szDriver = hb_rddDefaultDrv( NULL );
   }
   ulConnection = hb_parnl( 4 );

   pRDDNode = hb_rddFindNode( szDriver, &uiRddID );  /* find the RDDNODE */
   pName = hb_param( 1, HB_IT_STRING );

   if( pRDDNode && pName )
      hb_retl( SELF_DROP( pRDDNode, pName, hb_param( 2, HB_IT_STRING ),
                          ulConnection ) == HB_SUCCESS );
   else
      hb_errRT_DBCMD( EG_ARG, EDBCMD_EVAL_BADPARAMETER, NULL, HB_ERR_FUNCNAME );
}

HB_FUNC( HB_DBEXISTS )
{
   LPRDDNODE  pRDDNode;
   HB_USHORT  uiRddID;
   HB_ULONG   ulConnection;
   const char * szDriver;
   PHB_ITEM   pName;

   szDriver = hb_parc( 3 );
   if( ! szDriver ) /* no VIA RDD parameter, use default */
      szDriver = hb_rddDefaultDrv( NULL );

   ulConnection = hb_parnl( 4 );

   pRDDNode = hb_rddFindNode( szDriver, &uiRddID );  /* find the RDD */
   pName = hb_param( 1, HB_IT_STRING );

   if( pRDDNode && pName )
      hb_retl( SELF_EXISTS( pRDDNode, pName, hb_param( 2, HB_IT_STRING ),
                            ulConnection ) == HB_SUCCESS );
   else
      hb_errRT_DBCMD( EG_ARG, EDBCMD_EVAL_BADPARAMETER, NULL, HB_ERR_FUNCNAME );
}

HB_FUNC( HB_DBRENAME )
{
   LPRDDNODE  pRDDNode;
   HB_USHORT  uiRddID;
   HB_ULONG   ulConnection;
   const char * szDriver;
   PHB_ITEM   pTable, pIndex, pNewName;

   szDriver = hb_parc( 4 );
   if( ! szDriver ) /* no VIA RDD parameter, use default */
      szDriver = hb_rddDefaultDrv( NULL );

   ulConnection = hb_parnl( 5 );

   pRDDNode = hb_rddFindNode( szDriver, &uiRddID );  /* find the RDDNODE */
   pTable = hb_param( 1, HB_IT_STRING );
   pIndex = hb_param( 2, HB_IT_STRING );
   pNewName = hb_param( 3, HB_IT_STRING );
   if( pIndex && ! pNewName )
   {
      pNewName = pIndex;
      pIndex = NULL;
   }

   if( pRDDNode && pTable && pNewName )
      hb_retl( SELF_RENAME( pRDDNode, pTable, pIndex, pNewName,
                            ulConnection ) == HB_SUCCESS );
   else
      hb_errRT_DBCMD( EG_ARG, EDBCMD_EVAL_BADPARAMETER, NULL, HB_ERR_FUNCNAME );
}

Re: ADO RDD xHarbour

PostPosted: Tue Apr 07, 2015 1:47 pm
by Antonio Linares
Antonio,

adordd its almost finished and all "light" trials seem to be ok Not one line code changed!:D


Excellent! :-)

This is the real power of open source cooperative development:

Fernando and me started thinking about the importance of an ADO RDD and we started coding it. Later Miguel Marchuet cooperated also, and finally you completed it.

Simply great :-)

Re: ADO RDD xHarbour

PostPosted: Tue Apr 07, 2015 1:50 pm
by Antonio Linares
Antonio,

Time to announce it in the Harbour devel and users lists ;-)