ADO RDD xHarbour
Re: ADO RDD xHarbour
Lucas,
Seek with lSoftseek lLastfind and locate tested. Work.
Seek like dbf is never used unless seek expression corresponds to more than 1 field because we cannt use find.
In this case we use select
Otherwise we use find.
Bookmark its only used in ado_recno to save position.
Seems the array doesnt follow specs please check in adordd for index array
Format is:
{ { tablename, {indexnamea,indexexp}, {indexname2, indexexp} },;
{nexttablename, {nextindexname, indexexp} } }
Seek with lSoftseek lLastfind and locate tested. Work.
Seek like dbf is never used unless seek expression corresponds to more than 1 field because we cannt use find.
In this case we use select
Otherwise we use find.
Bookmark its only used in ado_recno to save position.
Seems the array doesnt follow specs please check in adordd for index array
Format is:
{ { tablename, {indexnamea,indexexp}, {indexname2, indexexp} },;
{nexttablename, {nextindexname, indexexp} } }
Regards
Antonio H Ferreira
Antonio H Ferreira
- lucasdebeltran
- Posts: 1303
- Joined: Tue Jul 21, 2009 8:12 am
- Contact:
Re: ADO RDD xHarbour
Antonio,
Yes, I follow that structure:
Yes, I follow that structure:
Code: Select all
LOCAL Alista_fic:= { { "LIBROS", {"LIBROS1", "TITULO"} } }
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.
Re: ADO RDD xHarbour
Lucas,
Please place in top ORDLSTFOCUS:
msgselect(aWAData[WA_INDEXES])
msginfo(aWAData[WA_INDEXACTIVE])
what values do you get?
Please place in top ORDLSTFOCUS:
msgselect(aWAData[WA_INDEXES])
msginfo(aWAData[WA_INDEXACTIVE])
what values do you get?
Regards
Antonio H Ferreira
Antonio H Ferreira
- lucasdebeltran
- Posts: 1303
- Joined: Tue Jul 21, 2009 8:12 am
- Contact:
Re: ADO RDD xHarbour
Hello,
xbrowse(aWAData[WA_INDEXES])
Is empty.
msginfo(aWAData[WA_INDEXACTIVE])
Gives 0.
Thank you
xbrowse(aWAData[WA_INDEXES])
Is empty.
msginfo(aWAData[WA_INDEXACTIVE])
Gives 0.
Thank you
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.
Re: ADO RDD xHarbour
Lucas,
Did you open the indexes with set index to or ordlistadd.
They are not opened with the table by adordd
They must be opened before ordsetfocus gets called
This is not the normal procedure with ordsetfocus that does nothing if the index
Its a guess
Did you open the indexes with set index to or ordlistadd.
They are not opened with the table by adordd
They must be opened before ordsetfocus gets called
This is not the normal procedure with ordsetfocus that does nothing if the index
Its a guess
Regards
Antonio H Ferreira
Antonio H Ferreira
Re: ADO RDD xHarbour
New adordd with relations and transactions https://github.com/AHFERREIRA/adordd.git
Regards
Antonio H Ferreira
Antonio H Ferreira
- lucasdebeltran
- Posts: 1303
- Joined: Tue Jul 21, 2009 8:12 am
- Contact:
Re: ADO RDD xHarbour
Antonio,
No, I didn´t use SET INDEX. Now it Work:
But there is a bug at OrdSetFocus(). It returns numbers, but it should return the tag name, i.e. LUCAS2.
For example:
Thank you.
No, I didn´t use SET INDEX. Now it Work:
Code: Select all
SET INDEX TO LUCAS1, LUCAS2
For example:
Code: Select all
LUCAS->( OrdSetFocus("MYLUCASBIS") )
Alert(OrdSetFocus()) shoud return MYLUCASBIS, not a number.
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.
Re: ADO RDD xHarbour
Lucas,
You re right! Corrected.
Could you please try the following :
dbseek with and without softseek expression = 1 indexkey and expression = 2 or more index keys
set relation and check how is performance.
Locking - Please remember that locks are virtual and arent placed in the files so in fact dont protect others from writing the locked file / record.
This is assured by transactions (new change from last adordd)
Locking only give us the records lock array to allow us to go back to the locks records wihtout disrupt the converted application logic.
First lock everything needs to an update then loop through the lock arrray and replace.
After unlock everything.
Transactions . begintrans with the 1st locks and endtrans with the 1st dbcommit.
For our app logic this works.
Are you coding (all code) in this way?
Is xBrowse running already?
Thanks
You re right! Corrected.
Could you please try the following :
dbseek with and without softseek expression = 1 indexkey and expression = 2 or more index keys
set relation and check how is performance.
Locking - Please remember that locks are virtual and arent placed in the files so in fact dont protect others from writing the locked file / record.
This is assured by transactions (new change from last adordd)
Locking only give us the records lock array to allow us to go back to the locks records wihtout disrupt the converted application logic.
First lock everything needs to an update then loop through the lock arrray and replace.
After unlock everything.
Transactions . begintrans with the 1st locks and endtrans with the 1st dbcommit.
For our app logic this works.
Are you coding (all code) in this way?
Is xBrowse running already?
Thanks
Regards
Antonio H Ferreira
Antonio H Ferreira
- lucasdebeltran
- Posts: 1303
- Joined: Tue Jul 21, 2009 8:12 am
- Contact:
Re: ADO RDD xHarbour
Antonio,
Can you send me the fix for indexes?. Also, have you received my email from yesterday?.
Also, for Harbour users, please add the following code:
at the top of adorrd.prg:
At ado_open():
at ADO_INFO()
at ado_append(), remove oRecordSet:Update().
Thank you.
Can you send me the fix for indexes?. Also, have you received my email from yesterday?.
Also, for Harbour users, please add the following code:
at the top of adorrd.prg:
Code: Select all
#ifndef __XHARBOUR__
#include "fivewin.ch" // as Harbour does not have TRY / CATCH
#define UR_FI_FLAGS 6
#define UR_FI_STEP 7
#define UR_FI_SIZE 5 // by Lucas for Harbour
#endif
ANNOUNCE ADORDD
//THREAD
STATIC t_cTableName
//THREAD
At ado_open():
Code: Select all
FOR n := 1 TO nTotalFields
aField := Array( UR_FI_SIZE )
aField[ UR_FI_NAME ] := oRecordSet:Fields( n - 1 ):Name
aField[ UR_FI_TYPE ] := ADO_FIELDSTRUCT( oRecordSet, n-1 )[7]
aField[ UR_FI_TYPEEXT ] := 0
aField[ UR_FI_LEN ] := ADO_FIELDSTRUCT( oRecordSet, n-1 )[3]
aField[ UR_FI_DEC ] := ADO_FIELDSTRUCT( oRecordSet, n-1 )[4]
#ifdef __XHARBOUR__
aField[ UR_FI_FLAGS ] := 0 // xHarbour expecs this field
aField[ UR_FI_STEP ] := 0 // xHarbour expecs this field
#endif
UR_SUPER_ADDFIELD( nWA, aField )
NEXT
nResult := UR_SUPER_OPEN( nWA, aOpenInfo )
at ADO_INFO()
Code: Select all
CASE uInfoType == DBI_FULLPATH // 10 /* The Full path to the data file */
//MSGINFO("IN SQL FULL PATH DOES NOT MATTER!")
uReturn := ""
at ado_append(), remove oRecordSet:Update().
Thank you.
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.
Re: ADO RDD xHarbour
Lucas,
I just saw your email but couldnt open prg extensions so please send next time with txt extension.
Im finnishing all changes and I l post new version asap.
Thanks
I just saw your email but couldnt open prg extensions so please send next time with txt extension.
Im finnishing all changes and I l post new version asap.
Thanks
Regards
Antonio H Ferreira
Antonio H Ferreira
Re: ADO RDD xHarbour
Posted new version https://github.com/AHFERREIRA/adordd.git
Regards
Antonio H Ferreira
Antonio H Ferreira
- lucasdebeltran
- Posts: 1303
- Joined: Tue Jul 21, 2009 8:12 am
- Contact:
Re: ADO RDD xHarbour
Antonio,
Thanks. Resent the email.
Now it works fine with Browse() and OrdSetFocus(), but not with xBrowse().
With xBrowse() I get:
Error description: Error BASE/1074 Error de argumento: <=
Args:
[ 1] = C LIBROS1
[ 2] = N 2
Stack Calls
===========
Called from: lucas2.prg => ADO_ORDINFO( 824 )
Called from: => ORDBAGNAME( 0 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:SETRDD( 4140 )
Called from: .\source\classes\XBROWSE.PRG => XBRWSETDATASOURCE( 13030 )
Called from: .\source\function\XBROWSER.PRG => XBROWSE( 112 )
Called from: lucas2.prg => MAIN( 87 )
ADO_ORDINFO( 824 ) is:
last line.
\source\classes\XBROWSE.PRG => TXBROWSE:SETRDD( 4140 )
Seems that same change applied to OrdSetFocus() should be done to OrdBagName()?.
Thank you.
Thanks. Resent the email.
Now it works fine with Browse() and OrdSetFocus(), but not with xBrowse().
With xBrowse() I get:
Error description: Error BASE/1074 Error de argumento: <=
Args:
[ 1] = C LIBROS1
[ 2] = N 2
Stack Calls
===========
Called from: lucas2.prg => ADO_ORDINFO( 824 )
Called from: => ORDBAGNAME( 0 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:SETRDD( 4140 )
Called from: .\source\classes\XBROWSE.PRG => XBRWSETDATASOURCE( 13030 )
Called from: .\source\function\XBROWSER.PRG => XBROWSE( 112 )
Called from: lucas2.prg => MAIN( 87 )
ADO_ORDINFO( 824 ) is:
Code: Select all
CASE nIndex == DBOI_BAGNAME
IF ! Empty( aWAData[ WA_INDEXES ] ) .AND. ! Empty( aOrderInfo[ UR_ORI_TAG ] ) .AND. ;
aOrderInfo[ UR_ORI_TAG ] <= LEN(aWAData[ WA_INDEXES ])
\source\classes\XBROWSE.PRG => TXBROWSE:SETRDD( 4140 )
Code: Select all
::aCols[ nFor ]:cOrdBag := ( cAlias )->( OrdBagName( ::aCols[ nFor ]:cSortOrder ) )
Seems that same change applied to OrdSetFocus() should be done to OrdBagName()?.
Thank you.
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.
Re: ADO RDD xHarbour
Ok it can receive either numeric order or name order.
Done https://github.com/AHFERREIRA/adordd.git
I ve made some changes Relations are not working anymore will revert soon.
Done https://github.com/AHFERREIRA/adordd.git
I ve made some changes Relations are not working anymore will revert soon.
Regards
Antonio H Ferreira
Antonio H Ferreira
- lucasdebeltran
- Posts: 1303
- Joined: Tue Jul 21, 2009 8:12 am
- Contact:
Re: ADO RDD xHarbour
Hello Antonio,
Thank you. Now xBrowse() seems to work.
However, some changes are required at adordd.prg:
i) You have ANNOUNCE ADORDD twice on top of it.
ii) Also, at ADO_OPEN() you have to comment out:
/*
aOpenInfo[ UR_OI_NAME ] += ".dbf"
hb_adoSetTable( aOpenInfo[ UR_OI_NAME ] )
hb_adoSetEngine( "")
hb_adoSetServer( "")
hb_adoSetQuery( )
hb_adoSetUser( "")
hb_adoSetPassword( "" )
*/
iii) And:
// aWAData[ WA_TABLENAME ] := SUBSTR(CFILENOPATH(aWAData[ WA_TABLENAME ] ),1,LEN(CFILENOPATH(aWAData[ WA_TABLENAME ] ))-4)
iv) Browses requiere mandatory at ADO_OPEN() :
oRecordSet:CursorLocation := adUseClient //its slower but has avntages such always bookmaks
oRecordSet:LockType := adLockOptimistic
Thank you.
Thank you. Now xBrowse() seems to work.
However, some changes are required at adordd.prg:
i) You have ANNOUNCE ADORDD twice on top of it.
ii) Also, at ADO_OPEN() you have to comment out:
/*
aOpenInfo[ UR_OI_NAME ] += ".dbf"
hb_adoSetTable( aOpenInfo[ UR_OI_NAME ] )
hb_adoSetEngine( "")
hb_adoSetServer( "")
hb_adoSetQuery( )
hb_adoSetUser( "")
hb_adoSetPassword( "" )
*/
iii) And:
// aWAData[ WA_TABLENAME ] := SUBSTR(CFILENOPATH(aWAData[ WA_TABLENAME ] ),1,LEN(CFILENOPATH(aWAData[ WA_TABLENAME ] ))-4)
iv) Browses requiere mandatory at ADO_OPEN() :
oRecordSet:CursorLocation := adUseClient //its slower but has avntages such always bookmaks
oRecordSet:LockType := adLockOptimistic
Thank you.
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.
- lucasdebeltran
- Posts: 1303
- Joined: Tue Jul 21, 2009 8:12 am
- Contact:
Re: ADO RDD xHarbour
Antonio,
In the LOCATE FOR command, it does not suport those ways:
LOCATE FOR FIELD->NAME ...
or
LOCATE FOR LUCASTABLE->NAME...
Thank you.
In the LOCATE FOR command, it does not suport those ways:
LOCATE FOR FIELD->NAME ...
or
LOCATE FOR LUCASTABLE->NAME...
Thank you.
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.