ADO RDD xHarbour

Re: ADO RDD xHarbour

Postby AHF » Thu Apr 02, 2015 7:04 pm

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

Re: ADO RDD xHarbour

Postby lucasdebeltran » Thu Apr 02, 2015 7:50 pm

Antonio,

Yes, I follow that structure:

Code: Select all  Expand view  RUN

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

Re: ADO RDD xHarbour

Postby AHF » Thu Apr 02, 2015 8:20 pm

Lucas,

Please place in top ORDLSTFOCUS:

msgselect(aWAData[WA_INDEXES])
msginfo(aWAData[WA_INDEXACTIVE])

what values do you get?
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby lucasdebeltran » Thu Apr 02, 2015 8:27 pm

Hello,

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

Re: ADO RDD xHarbour

Postby AHF » Thu Apr 02, 2015 8:51 pm

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

Re: ADO RDD xHarbour

Postby AHF » Thu Apr 02, 2015 9:51 pm

New adordd with relations and transactions https://github.com/AHFERREIRA/adordd.git
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby lucasdebeltran » Fri Apr 03, 2015 7:05 am

Antonio,

No, I didn´t use SET INDEX. Now it Work:

Code: Select all  Expand view  RUN
SET INDEX TO LUCAS1, LUCAS2


But there is a bug at OrdSetFocus(). It returns numbers, but it should return the tag name, i.e. LUCAS2.

For example:

Code: Select all  Expand view  RUN


LUCAS->(  OrdSetFocus("MYLUCASBIS")  )

Alert(OrdSetFocus()) shoud return MYLUCASBIS, not a number.


 


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

Re: ADO RDD xHarbour

Postby AHF » Fri Apr 03, 2015 7:34 am

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

Re: ADO RDD xHarbour

Postby lucasdebeltran » Fri Apr 03, 2015 7:44 am

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:

Code: Select all  Expand view  RUN

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

Re: ADO RDD xHarbour

Postby AHF » Fri Apr 03, 2015 8:32 am

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

Re: ADO RDD xHarbour

Postby AHF » Fri Apr 03, 2015 9:01 am

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

Re: ADO RDD xHarbour

Postby lucasdebeltran » Fri Apr 03, 2015 9:40 am

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:


Code: Select all  Expand view  RUN
  CASE nIndex == DBOI_BAGNAME

        IF ! Empty( aWAData[ WA_INDEXES ] ) .AND. ! Empty( aOrderInfo[ UR_ORI_TAG ] ) .AND. ;
            aOrderInfo[ UR_ORI_TAG ] <= LEN(aWAData[ WA_INDEXES ])


last line.



\source\classes\XBROWSE.PRG => TXBROWSE:SETRDD( 4140 )

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

Re: ADO RDD xHarbour

Postby AHF » Fri Apr 03, 2015 10:14 am

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

Re: ADO RDD xHarbour

Postby lucasdebeltran » Fri Apr 03, 2015 10:27 am

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.
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

Re: ADO RDD xHarbour

Postby lucasdebeltran » Fri Apr 03, 2015 10:39 am

Antonio,

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.
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 40 guests

cron