ADO RDD xHarbour

hmpaquito
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: ADO RDD xHarbour

Post by hmpaquito »

A la luz del fuente: https://github.com/AHFERREIRA/adordd/bl ... adordd.prg quizás necesites incluir en tu codigo un SKIP 0 (refresh())
rodrigoppt
Posts: 7
Joined: Thu Mar 31, 2022 5:10 pm

Re: ADO RDD xHarbour

Post by rodrigoppt »

Usé SKIP 0, aun así no actualiza el último registro.

Abro dos aplicaciones y dejo un stop en la pantalla de xbrowse, y en la otra creo un registro nuevo, y no actualiza en la otra que esta parada en xbrowse. La única forma que pude, fue terminar el banco y abrirlo de nuevo, luego aparece el último registro creado.

¿Tienes alguna otra manera?

Code: Select all | Expand


CLOSE SLGRUP
USE SLGRUP
SLGRUP->(DBSETORDER(01))
DBSKIP(0)
oGruLbx:oDbf:= "SLGRUP"
oGruLbx:Refresh()
 
hmpaquito
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: ADO RDD xHarbour

Post by hmpaquito »

Hola,

Supongo que el SKIP 0 lo hiciste en el otro lado, en el lado que no añadio el registro.
Siendo lo anterior ¿ Podrias probar a hacer un GO TOP ?

Hay un mensaje que habla de este tema... pero no resuelve mucho.. Seria este: https://groups.google.com/g/comp.lang.x ... PvXVkzCAAJ


En todo caso, en el fuente de ADORDD parece que este tema esta previsto y la nativa fundamental ADO_REFRESH lo contempla. Asi un SKIP 0 o un GO TOP deberian funcionar

Code: Select all | Expand

STATIC FUNCTION ADO_REFRESH( nWA, lRequery ) //22.08.15
   LOCAL aWAData := USRRDD_AREADATA( nWA )
   LOCAL nReccount
   LOCAL nRecno, xKey, aSeek, oRs, cSql
   LOCAL lOnlyfirstField := .T., oClone

   IF !ADOCON_CHECK()
      RETURN HB_FAILURE

   ENDIF

   nReccount := ADORECCOUNT( nWA, aWAData[ WA_RECORDSET ] )
   lRequery := IF( lRequery == NIL, .F., lRequery )

   IF !aWAData[ WA_RECORDSET ]:Eof() .AND.!aWAData[ WA_RECORDSET ]:bof()
      nRecno := aWAData[ WA_RECORDSET ]:Fields(aWAData[WA_FIELDRECNO]):Value

   ELSE
      RETURN HB_SUCCESS

   ENDIF

   IF lRequery
      ADO_REQUERY( nWA , aWAData[ WA_RECORDSET ] )
      aWAData[ WA_RECCOUNT ] := nReccount
      aWAData[ WA_LREQUERY ] := .T. //already requeried set to .f.

      ADO_GOTO( nWA, nRecNo )
      IF aWAData[ WA_RECORDSET ]:Eof()
         // record does not exist anymore other app delete it!
         THROW( ErrorNew( "ADORDD", 10002, 10002, "Record move "+aWAData [ WA_TABLENAME] ,;
                   STR(  nRecNo )+ "was deleted by other app and ADORDD cant reposition " ) )

      ENDIF

      RETURN HB_SUCCESS

   ENDIF

   IF VALTYPE( aWAData[ WA_RECCOUNT ] ) == "U" //initialize
      aWAData[ WA_RECCOUNT ] := nReccount
      RETURN HB_SUCCESS

   ELSE
      // NEW RECORDS ADDED BY OTHERS?
      IF aWAData[ WA_RECCOUNT ] < nReccount //only new records
         //PAY ATTENTION TO ADOWHERECLAUSE AND SET RECORDSET OPEN WHERE CLAUSE BECAUSE THE NEW RECORD MIGHT NOT BE VISIBLE!
         ADO_REQUERY( nWA , aWAData[ WA_RECORDSET ] )
         aWAData[ WA_LREQUERY ] := .T. //already requeried set to .f.
         //re initialize
         aWAData[ WA_RECCOUNT ] := nReccount

         ADO_GOTO( nWA, nRecNo )

         IF aWAData[ WA_RECORDSET ]:Eof()
            // record does not exist anymore other app delete it!
            THROW( ErrorNew( "ADORDD", 10002, 10002, "Record move "+aWAData [ WA_TABLENAME] ,;
                   STR(  nRecNo )+ "was deleted by other app and ADORDD cant reposition " ) )

         ENDIF

      ENDIF

   ENDIF

   RETURN HB_SUCCESS


Salu2
rodrigoppt
Posts: 7
Joined: Thu Mar 31, 2022 5:10 pm

Re: ADO RDD xHarbour

Post by rodrigoppt »

Así que intenté poner SKIP 0 y GO TOP después de escribir el registro y no actualiza xbrowse en el otro.
También intente actualizar xbrowse y no aparece, solo aparece el registro nuevo en el sistema que lo lanzó, en el otro no aparece.
hmpaquito
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: ADO RDD xHarbour

Post by hmpaquito »

Intenta contactar con el autor de la clase. Quizá él pueda dar alguna pauta
User avatar
Rick Lipkin
Posts: 2668
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: ADO RDD xHarbour

Post by Rick Lipkin »

Gemtleman

I have been using ( plain ) ADO ( class and methods ) for many years .. 32 and 64 bits ... Have a look in the samples folder and compile AdoRick.prg .. Uses all the Fivewin code .. xbrowse, panels, folders ... etc.

You can use ADO to connect to MS Sql Server, MS Access and ( most ) all the other Sql databases as well ... Rao has made the ADO connection syntax with many FiveWin wrappers .. Look in the \source\functions\adofuncs.prg ..

Thanks
Rick Lipkin
User avatar
Marc Venken
Posts: 1482
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: ADO RDD xHarbour

Post by Marc Venken »

Rick Lipkin wrote:Gemtleman

I have been using ( plain ) ADO ( class and methods ) for many years .. 32 and 64 bits ... Have a look in the samples folder and compile AdoRick.prg .. Uses all the Fivewin code .. xbrowse, panels, folders ... etc.

You can use ADO to connect to MS Sql Server, MS Access and ( most ) all the other Sql databases as well ... Rao has made the ADO connection syntax with many FiveWin wrappers .. Look in the \source\functions\adofuncs.prg ..

Thanks
Rick Lipkin


Rick,

In your experience with mainly viewing large Xbrowse setups with many tags and editing mostly from inside the Xbrowse :
Would you think that ADO (with the Mr. Rao tools) and FW give a better performance than with DBF files, DBFCDX, TAG and FW ?
Marc Venken
Using: FWH 23.08 with Harbour
User avatar
Otto
Posts: 6396
Joined: Fri Oct 07, 2005 7:07 pm
Has thanked: 8 times
Been thanked: 1 time
Contact:

Re: ADO RDD xHarbour

Post by Otto »

Marc,
Do you also have speed problems on the PC where you saved your DBF files.
Regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Marc Venken
Posts: 1482
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: ADO RDD xHarbour

Post by Marc Venken »

Otto wrote:Marc,
Do you also have speed problems on the PC where you saved your DBF files.
Regards,
Otto


No, On the pc with the dbf's the program is ok.

On the peer to peer (like it is) speed improvement would be nice. But I can absolutely be a issue of hardware / settings on de pc's..
I'm not a IT guy.... So I take a PC out of the box, connect it to the netwerk and have a //PCMARC//.... path

I have I7 an I5, SSD and 1000 g/Network
Marc Venken
Using: FWH 23.08 with Harbour
User avatar
Otto
Posts: 6396
Joined: Fri Oct 07, 2005 7:07 pm
Has thanked: 8 times
Been thanked: 1 time
Contact:

Re: ADO RDD xHarbour

Post by Otto »

Marc,

use your software form the other PCs with RDP.

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Rick Lipkin
Posts: 2668
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: ADO RDD xHarbour

Post by Rick Lipkin »

To All

As far as updating any .dbf record ... I use goto Recno() .. that in many cases mimics dbCommit() .. goto Recno() forces the record pointer to move albeit .. back to itself.

Rick Lpkin
rodrigoppt
Posts: 7
Joined: Thu Mar 31, 2022 5:10 pm

Re: ADO RDD xHarbour

Post by rodrigoppt »

Resolvido, com a ajuda do AHF, descobri que na função do ADORECCOUNT não estava definido o MYSQL.
Adicionei o aAWData[ WA_ENGINE ]== "MYSQL" no final do primeiro IF.

Obrigado.

Code: Select all | Expand

  // 30.06.15
   IF aAWData[ WA_ENGINE ] = "ACCESS" .OR. aAWData[ WA_ENGINE ] = "SQLITE" .OR.;
      aAWData[ WA_ENGINE ] = "FIREBIRD" .OR. aAWData[ WA_ENGINE ]== "POSTGRE" .OR.;
      aAWData[ WA_ENGINE ]== "ORACLE" .OR. aAWData[ WA_ENGINE ]== "MYSQL" // ADICIONADO MYSQL
      //6.08.15 ONLY WITH ACCESSIT TAKES LONGER IN BIG TABLES
      cSql := "SELECT MAX("+( ADO_GET_FIELD_RECNO( aAWData[WA_TABLEINDEX]  ) )+")+1 FROM "+aAWData[WA_TABLENAME]

   ELSEIF aAWData[ WA_ENGINE ] = "MSSQL"
      cSql := "SELECT IDENT_CURRENT('"+aAWData[WA_TABLENAME]+"')+1 AS AUTO_INCREMENT"

   ELSE
      //30.06.15 REPLACED BY RAO NAGES IDEA next incremente key
      cSql := "SELECT `AUTO_INCREMENT` FROM INFORMATION_SCHEMA.TABLES"+;
              " WHERE TABLE_SCHEMA = '"+aAWData[ WA_CATALOG ]+"' AND TABLE_NAME = '"+aAWData[ WA_TABLENAME ]+"'"
   ENDIF
rodrigoppt
Posts: 7
Joined: Thu Mar 31, 2022 5:10 pm

Re: ADO RDD xHarbour

Post by rodrigoppt »

Does anyone know if there is any way to increase the conversion speed of hb_adoupload?
Post Reply