ADO RDD xHarbour

Re: ADO RDD xHarbour

Postby Antonio Linares » Wed Apr 29, 2015 10:37 am

Antonio,

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

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

Re: ADO RDD xHarbour

Postby AHF » Wed Apr 29, 2015 5:26 pm

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: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby AHF » Thu Apr 30, 2015 8:26 am

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
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby Antonio Linares » Thu Apr 30, 2015 7:33 pm

Antonio,

Code: Select all  Expand view  RUN
#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
User avatar
Antonio Linares
Site Admin
 
Posts: 42103
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: ADO RDD xHarbour

Postby AHF » Fri May 01, 2015 9:58 am

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  Expand view  RUN

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


The first time found following times not found.

Have you tried adordd?
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby Antonio Linares » Fri May 01, 2015 3:29 pm

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: 42103
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: ADO RDD xHarbour

Postby Antonio Linares » Fri May 01, 2015 3:30 pm

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
User avatar
Antonio Linares
Site Admin
 
Posts: 42103
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: ADO RDD xHarbour

Postby AHF » Fri May 01, 2015 9:46 pm

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 to scan. 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  Expand view  RUN

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: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby AHF » Fri May 01, 2015 9:54 pm

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
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby Antonio Linares » Fri May 01, 2015 9:56 pm

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
User avatar
Antonio Linares
Site Admin
 
Posts: 42103
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: ADO RDD xHarbour

Postby AHF » Sat May 02, 2015 8:10 am

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  Expand view  RUN
nLen     :=  Max( 19, oField:Precision + 2 )  


Shouldnt it be:
Code: Select all  Expand view  RUN
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: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby AHF » Sat May 02, 2015 8:12 am

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
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby nageswaragunupudi » Sat May 02, 2015 12:16 pm

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  Expand view  RUN
nLen     :=  Max( 19, oField:Precision + 2 )  


Shouldnt it be:
Code: Select all  Expand view  RUN
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
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: ADO RDD xHarbour

Postby AHF » Sat May 02, 2015 4:11 pm

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
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby lucasdebeltran » Sat May 02, 2015 5:46 pm

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.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 61 guests