FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour ADO RDD xHarbour
Posts: 7
Joined: Thu Mar 31, 2022 05:10 PM

Re: ADO RDD xHarbour

Posted: Wed Apr 13, 2022 08:31 PM
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 (fw): Select all Collapse
CLOSE SLGRUP
USE SLGRUP
SLGRUP->(DBSETORDER(01))
DBSKIP(0)
oGruLbx:oDbf:= "SLGRUP"
oGruLbx:Refresh()
Posts: 1515
Joined: Thu Oct 30, 2008 02:37 PM

Re: ADO RDD xHarbour

Posted: Thu Apr 14, 2022 11:48 AM
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 (fw): Select all Collapse
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
Posts: 7
Joined: Thu Mar 31, 2022 05:10 PM

Re: ADO RDD xHarbour

Posted: Mon Apr 18, 2022 08:15 PM

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.

Posts: 1515
Joined: Thu Oct 30, 2008 02:37 PM

Re: ADO RDD xHarbour

Posted: Tue Apr 19, 2022 07:28 PM

Intenta contactar con el autor de la clase. Quizá él pueda dar alguna pauta

Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM

Re: ADO RDD xHarbour

Posted: Wed Apr 20, 2022 12:39 PM

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

Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM

Re: ADO RDD xHarbour

Posted: Thu Apr 21, 2022 04:45 PM
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
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM

Re: ADO RDD xHarbour

Posted: Thu Apr 21, 2022 06:38 PM

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

Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM

Re: ADO RDD xHarbour

Posted: Fri Apr 22, 2022 07:37 AM
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
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM

Re: ADO RDD xHarbour

Posted: Fri Apr 22, 2022 09:12 AM

Marc,

use your software form the other PCs with RDP.

Best regards,
Otto

Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM

Re: ADO RDD xHarbour

Posted: Fri Apr 22, 2022 12:21 PM

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

Posts: 7
Joined: Thu Mar 31, 2022 05:10 PM

Re: ADO RDD xHarbour

Posted: Thu Apr 28, 2022 02:50 PM
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 (fw): Select all Collapse
   // 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
Posts: 7
Joined: Thu Mar 31, 2022 05:10 PM

Re: ADO RDD xHarbour

Posted: Tue Nov 21, 2023 08:46 PM

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

Continue the discussion