ADO RDD xHarbour

User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: ADO RDD xHarbour

Post by Antonio Linares »

Antonio,

I just sent an email to Mr. Rao asking him
regards, saludos

Antonio Linares
www.fivetechsoft.com
AHF
Posts: 837
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Post by AHF »

New adordd version with working locking as dbfs at https://github.com/AHFERREIRA/adordd.git

This is still on trial and its working quite well on heavy transactions many records in many tables.
It assures completely record locking and concurrent access control like any other rdd.

The drawback is that we must use a dbf table in a network share with another rdd for this to work.
Its very small recsize only 50b and has a recycle scheme for records not needed.

Still have some issues with dates and NULL values in adordd.
Regards
Antonio H Ferreira
AHF
Posts: 837
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Post by AHF »

Antonio,

Any news regarding date functions?

Now Im taking care of :
copy to (cfile) WHILE ....

This function calls ADO_APPEND but the nWA received its a new one.
Probably this function selects a new area to copy file to.

Can we somehow change it or do we have to write a replacement from scratch.
Where can I find this function?
Regards
Antonio H Ferreira
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: ADO RDD xHarbour

Post by Antonio Linares »

Antonio,

Code: Select all

#pragma BEGINDUMP

#include <windows.h>
#include <hbapi.h>

HB_FUNC( FW_TTOD )
{
   hb_retdl( hb_pardl( 1 ) );
}

HB_FUNC( FW_DTOT )
{

#ifdef __XHARBOUR__
   hb_retdtl( hb_pardl( 1 ), hb_part( 1 ) );
#else
   long lJulian;
   long lMilliSecs;

   hb_partdt( &lJulian, &lMilliSecs, 1 );
   hb_rettdt( lJulian, lMilliSecs );
#endif
}

#pragma ENDDUMP
 
regards, saludos

Antonio Linares
www.fivetechsoft.com
AHF
Posts: 837
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Post by AHF »

Antonio,

Thanks for the code.

adordd its working almost perfectly.

Antonio, Mr Rao,

But I've still 2 pending problems:

1) Fields N without any decimal returning 2 decimals. (xxx.00) Do you have any idea what might be the problem.

2) Locates. Can you check the adordd.prg ado_locate to see what might be the problem?

If we do :

Code: Select all

(calias)->(__dblocate( {|| namefiled->name = cNname} ))
 
The first time found following times not found.

Have you tried adordd?
Regards
Antonio H Ferreira
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: ADO RDD xHarbour

Post by Antonio Linares »

Antonio,
1) Fields N without any decimal returning 2 decimals. (xxx.00) Do you have any idea what might be the problem.
Do you use any C code ? if yes then check if hb_retnd() is used somewhere and change it into hb_retnl()
regards, saludos

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

Re: ADO RDD xHarbour

Post by Antonio Linares »

Antonio,
2) Locates. Can you check the adordd.prg ado_locate to see what might be the problem?
Surely you need to do a oRecordSet:GoTop() before running the locate code.
regards, saludos

Antonio Linares
www.fivetechsoft.com
AHF
Posts: 837
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Post by AHF »

Antonio,
Antonio Linares wrote:Antonio,
2) Locates. Can you check the adordd.prg ado_locate to see what might be the problem?
Surely you need to do a oRecordSet:GoTop() before running the locate code.
xHarbour help
<Scope>
This option defines the number of records _. It defaults to ALL. The NEXT <nCount> scope scans the next <nCount> records, while REST scans records beginning from the current record to the end of file. The search begins with the first record unless a scope is defined.
ADO_LOCATE code

Code: Select all

STATIC FUNCTION ADO_LOCATE( nWA, lContinue )

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

   
   IF ADOEMPTYSET(oRecordSet)
      RETURN HB_FAILURE
   ENDIF
 
   IF !lContinue 
      oRecordSet:MoveFirst() //START FROM BEGINING
   ELSE
      oRecordSet:MoveNext() //WE DONT WANT TO FIND THIS ONE AGAIN
   ENDIF
   CURSORWAIT()
   DO WHILE !oRecordSet:EoF()
      [b]IF EVAL( aWAData[ WA_SCOPEINFO ][ UR_SI_BFOR ])[/b]
         aWAData[ WA_FOUND ] := .T.
         EXIT
      ENDIF  
      oRecordSet:MoveNext()
      SYSREFRESH()
   ENDDO
   CURSORARROW()
    
   aWAData[ WA_FOUND ] := ! oRecordSet:EOF
   aWAData[ WA_EOF ] := oRecordSet:EOF
  
   
   RETURN HB_SUCCESS
 
Somehow the eval() doesn't return .t. although is passing the record where it should.
Regards
Antonio H Ferreira
AHF
Posts: 837
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Post by AHF »

Antonio Linares wrote:Antonio,
1) Fields N without any decimal returning 2 decimals. (xxx.00) Do you have any idea what might be the problem.
Do you use any C code ? if yes then check if hb_retnd() is used somewhere and change it into hb_retnl()
No hb_retnd() .
But if I used it and worked with other rdds should work also with adordd.

Any other idea?
Regards
Antonio H Ferreira
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: ADO RDD xHarbour

Post by Antonio Linares »

Antonio,

Try this:

(calias)->(__dblocate( {|| MsgInfo( namefiled->name, cNname ), namefiled->name = cNname} ))

And check what it shows

> Fields N without any decimal returning 2 decimals. (xxx.00)

Try to check the size of the field and use int() when its not a decimal
regards, saludos

Antonio Linares
www.fivetechsoft.com
AHF
Posts: 837
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Post by AHF »

Antonio, Mr Rao,
Try to check the size of the field and use int() when its not a decimal
Solved!

In adofuncs.prg you have:

Code: Select all

 nLen     :=  Max( 19, oField:Precision + 2 )  
Shouldnt it be:

Code: Select all

 nLen     := Min( 19, oField:Precision  )   //
Otherwise we will have all fields much bigger because the minimum it will be 19.
Why not only oField:Precision?
Regards
Antonio H Ferreira
AHF
Posts: 837
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Post by AHF »

Antonio,
(calias)->(__dblocate( {|| MsgInfo( namefiled->name, cNname ), namefiled->name = cNname} ))

And check what it shows
It seems after 1st time a loose the codeblock I checking why.
Regards
Antonio H Ferreira
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: ADO RDD xHarbour

Post by nageswaragunupudi »

AHF wrote:Antonio, Mr Rao,
Try to check the size of the field and use int() when its not a decimal
Solved!

In adofuncs.prg you have:

Code: Select all

 nLen     :=  Max( 19, oField:Precision + 2 )  
Shouldnt it be:

Code: Select all

 nLen     := Min( 19, oField:Precision  )   //
Otherwise we will have all fields much bigger because the minimum it will be 19.
Why not only oField:Precision?
Thanks. I am correcting Max to Min in adofuncs.prg.
+2 is for ( 1 decimal place and 1 minus sign )
Regards

G. N. Rao.
Hyderabad, India
AHF
Posts: 837
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Post by AHF »

Mr Rao,
+2 is for ( 1 decimal place and 1 minus sign )
In dbf when we say field,"N" ,11,4 the total length f the field is 11 but in fact one is taken for the "." decimal
so we only have 6,4 and if we want a minus we only have 5,4.
Shouldn't we use the same criteria in adordd ?

Besides that if we create a field, "N", 10 ,2 in ACCESS in adofuncs it is considered as "MONEY" why?
Regards
Antonio H Ferreira
User avatar
lucasdebeltran
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am
Contact:

Re: ADO RDD xHarbour

Post by lucasdebeltran »

Antonio,

Money must be used with 2 decimals because there is a bug with Access.
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
Post Reply