ADO RDD xHarbour

Re: ADO RDD xHarbour

Postby Antonio Linares » Sun Mar 22, 2015 10:30 am

Antonio,

Your code looks fine. What is missing ?

If you don't mind I am going to share your version so other users may try it too, thanks

https://bitbucket.org/fivetech/fivewin-contributions/downloads/adordd.prg
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: ADO RDD xHarbour

Postby AHF » Sun Mar 22, 2015 10:33 am

Antonio,

Dbrocklist() returns zero
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby Antonio Linares » Sun Mar 22, 2015 10:57 am

Antonio,

Please place a MsgInfo() in function ADO_ORDINFO() and check if it is shown when you call to Dbrlocklist()
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: ADO RDD xHarbour

Postby AHF » Sun Mar 22, 2015 11:19 am

Antonio,

I did that already.
Dbrlocklist doesnt call ado_ordinfo.
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby AHF » Sun Mar 22, 2015 11:41 am

Antonio,

Dbrlocklist is a area/table related information and not index.

I think drblocklist is calling dbinfo with the corresponding #define.

When we open a recorset we load to UR_SUPER_OPEN( nWA, aOpenInfo ) all openinfo.

Can we do something of the kind with locks and unlocks to keep locklist always updated?
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby Antonio Linares » Sun Mar 22, 2015 11:43 am

Antonio,

Yes, you are right, it is DbInfo()

What we are not going to lock any records, so what do you need that for ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: ADO RDD xHarbour

Postby AHF » Sun Mar 22, 2015 12:00 pm

AHF wrote:Antonio,

Its absolutly necessary to keep the locklist array.

In transactions we lock and append all necessary records and then we loop trough the locklist with dbgoto to make all replaces. If a lock fails the transaction fails.

Altough with ADO never fails as real locks dont matter we still need to have it filled with bookmarks to return to each record later.
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby Antonio Linares » Sun Mar 22, 2015 3:23 pm

Antonio,

So the array that you have to return is aWdata[ WA_LOCKLIST ]
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: ADO RDD xHarbour

Postby AHF » Sun Mar 22, 2015 3:55 pm

Antonio,

Yes thats the array I created for that porpose and its already updated by ado_lock and ado_unlock.
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby Antonio Linares » Sun Mar 22, 2015 5:40 pm

Can't you return it from DbInfo() ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: ADO RDD xHarbour

Postby AHF » Sun Mar 22, 2015 6:31 pm

Antonio,

No. The problem is that I must pass somewhere the locklist array that I build but dont know where and how.
I dont have any other rdd.prg source to check it out.
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby Antonio Linares » Sun Mar 22, 2015 9:53 pm

See the source code for dbinfo():

Code: Select all  Expand view
HB_FUNC( DBINFO )
{
   AREAP pArea = ( AREAP ) hb_rddGetCurrentWorkAreaPointer();

   if( pArea )
   {
      PHB_ITEM pIndex;

      pIndex = hb_param( 1, HB_IT_NUMERIC );
      if( pIndex )
      {
         PHB_ITEM pInfo = hb_itemNew( hb_param( 2, HB_IT_ANY ) );

         SELF_INFO( pArea, ( HB_USHORT ) hb_itemGetNI( pIndex ), pInfo );
         hb_itemReturnRelease( pInfo );
      }
      else
         hb_errRT_DBCMD( EG_ARG, EDBCMD_DBINFOBADPARAMETER, NULL, HB_ERR_FUNCNAME );
   }
   else
      hb_errRT_DBCMD( EG_NOTABLE, EDBCMD_NOTABLE, NULL, HB_ERR_FUNCNAME );
}
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: ADO RDD xHarbour

Postby AHF » Mon Mar 23, 2015 8:41 am

Antonio,

I dont understand it.
As I said before I dont know nothing about rdd specs and the way of working.

I define #define WA_LOCKLIST 22

Cant we do with dbrlocklist something like

aADOFunc[ UR_LOCK ] := (@ADO_LOCK())

Then I would have acess to my locklist array.
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby AHF » Mon Mar 23, 2015 8:46 am

Antonio,

What this needed for:

Code: Select all  Expand view
STATIC FUNCTION ADO_RAWLOCK( nWA, nAction, nRecNo )

// LOCAL oRecordSet := USRRDD_AREADATA( nWA )[ WA_RECORDSET ]

   /* TODO */

   HB_SYMBOL_UNUSED( nRecNo )
   HB_SYMBOL_UNUSED( nWA )
   HB_SYMBOL_UNUSED( nAction )

   RETURN HB_SUCCESS
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby AHF » Mon Mar 23, 2015 10:06 am

Antonio,

FieldLen and FieldSize return nil

I've tested in the adorrd before UR_SUPER_ADDFIELD( nWA, aField ) and the values are correct.

What can we do?
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 75 guests