ADO RDD xHarbour
- Antonio Linares
- Site Admin
- Posts: 42461
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 20 times
- Been thanked: 58 times
- Contact:
Re: ADO RDD xHarbour
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.
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
Antonio H Ferreira
Re: ADO RDD xHarbour
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?
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
Antonio H Ferreira
- Antonio Linares
- Site Admin
- Posts: 42461
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 20 times
- Been thanked: 58 times
- Contact:
Re: ADO RDD xHarbour
Antonio,
Code: Select all | Expand
#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
Re: ADO RDD xHarbour
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 :
The first time found following times not found.
Have you tried adordd?
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
(calias)->(__dblocate( {|| namefiled->name = cNname} ))
The first time found following times not found.
Have you tried adordd?
Regards
Antonio H Ferreira
Antonio H Ferreira
- Antonio Linares
- Site Admin
- Posts: 42461
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 20 times
- Been thanked: 58 times
- Contact:
Re: ADO RDD xHarbour
Antonio,
Do you use any C code ? if yes then check if hb_retnd() is used somewhere and change it into hb_retnl()
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()
- Antonio Linares
- Site Admin
- Posts: 42461
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 20 times
- Been thanked: 58 times
- Contact:
Re: ADO RDD xHarbour
Antonio,
Surely you need to do a oRecordSet:GoTop() before running the locate code.
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.
Re: ADO RDD xHarbour
Antonio,
xHarbour help
ADO_LOCATE code
Somehow the eval() doesn't return .t. although is passing the record where it should.
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
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
Antonio H Ferreira
Re: ADO RDD xHarbour
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
Antonio H Ferreira
- Antonio Linares
- Site Admin
- Posts: 42461
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 20 times
- Been thanked: 58 times
- Contact:
Re: ADO RDD xHarbour
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
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
Re: ADO RDD xHarbour
Antonio, Mr Rao,
Solved!
In adofuncs.prg you have:
Shouldnt it be:
Otherwise we will have all fields much bigger because the minimum it will be 19.
Why not only oField:Precision?
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
nLen := Max( 19, oField:Precision + 2 )
Shouldnt it be:
Code: Select all | Expand
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
Antonio H Ferreira
Re: ADO RDD xHarbour
Antonio,
It seems after 1st time a loose the codeblock I checking why.
(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
Antonio H Ferreira
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: ADO RDD xHarbour
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
nLen := Max( 19, oField:Precision + 2 )
Shouldnt it be:Code: Select all | Expand
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
G. N. Rao.
Hyderabad, India
Re: ADO RDD xHarbour
Mr Rao,
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?
+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
Antonio H Ferreira
- lucasdebeltran
- Posts: 1303
- Joined: Tue Jul 21, 2009 8:12 am
- Contact:
Re: ADO RDD xHarbour
Antonio,
Money must be used with 2 decimals because there is a bug with Access.
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.
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.