ADO RDD xHarbour

Re: ADO RDD xHarbour

Postby hmpaquito » Wed Apr 13, 2022 6:21 pm

A la luz del fuente: https://github.com/AHFERREIRA/adordd/bl ... adordd.prg quizás necesites incluir en tu codigo un SKIP 0 (refresh())
hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: ADO RDD xHarbour

Postby rodrigoppt » Wed Apr 13, 2022 8: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: Select all  Expand view  RUN

CLOSE SLGRUP
USE SLGRUP
SLGRUP->(DBSETORDER(01))
DBSKIP(0)
oGruLbx:oDbf:= "SLGRUP"
oGruLbx:Refresh()
 
rodrigoppt
 
Posts: 7
Joined: Thu Mar 31, 2022 5:10 pm

Re: ADO RDD xHarbour

Postby hmpaquito » 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: Select all  Expand view  RUN
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
hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: ADO RDD xHarbour

Postby rodrigoppt » Mon Apr 18, 2022 8: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.
rodrigoppt
 
Posts: 7
Joined: Thu Mar 31, 2022 5:10 pm

Re: ADO RDD xHarbour

Postby hmpaquito » Tue Apr 19, 2022 7:28 pm

Intenta contactar con el autor de la clase. Quizá él pueda dar alguna pauta
hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: ADO RDD xHarbour

Postby Rick Lipkin » 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
User avatar
Rick Lipkin
 
Posts: 2666
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: ADO RDD xHarbour

Postby Marc Venken » Thu Apr 21, 2022 4: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.04 with Harbour
User avatar
Marc Venken
 
Posts: 1446
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: ADO RDD xHarbour

Postby Otto » Thu Apr 21, 2022 6:38 pm

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
Otto
 
Posts: 6346
Joined: Fri Oct 07, 2005 7:07 pm

Re: ADO RDD xHarbour

Postby Marc Venken » Fri Apr 22, 2022 7: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.04 with Harbour
User avatar
Marc Venken
 
Posts: 1446
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: ADO RDD xHarbour

Postby Otto » Fri Apr 22, 2022 9:12 am

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
Otto
 
Posts: 6346
Joined: Fri Oct 07, 2005 7:07 pm

Re: ADO RDD xHarbour

Postby Rick Lipkin » 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
User avatar
Rick Lipkin
 
Posts: 2666
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: ADO RDD xHarbour

Postby rodrigoppt » Thu Apr 28, 2022 2: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: Select all  Expand view  RUN
  // 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

Postby rodrigoppt » Tue Nov 21, 2023 8:46 pm

Does anyone know if there is any way to increase the conversion speed of hb_adoupload?
rodrigoppt
 
Posts: 7
Joined: Thu Mar 31, 2022 5:10 pm

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 31 guests