how to update a remote DBF

User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

how to update a remote DBF

Post by Otto »

Hello,
is it possible to update a DBF file on a remote system.
Thank you in advance
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
User avatar
MarcoBoschi
Posts: 925
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

Re: how to update a remote DBF

Post by MarcoBoschi »

Otto,
you can update a remote dbf in real time in this way
- write in a log dbf table every time a user touch a record (User=001 Dbf=Customer Recno=10 Do=20190730140301)
- a program that is always active read in polling from this log table if there are news records to process and if a new records is found:
open local dbf
open remote dbf (they are identical in structure)
verifies if record 100 is present in the two tables
if record does not exist makes an append blank until does not reach the number of records
perform a comparison of every single field of the same record writing the differences in remote dbf
I use this software since there were several archival corruption issues (corruption detected)
I saved the contents of the tables many times without recovering from the night before but at most from one minute before the corruption.

This could be another solution for those situations in which is very difficult to open two dbf (local and remote)
SELECT 0
USE fa ALIAS local
SELECT 0
USE fa ALIAS remote



For every modified record you can create a dbf table with this name
for example
FA#0000000001#num_fa#FA_00001-------#20190730140101.dbf
where
FA is the name of te table
#0000000001 is the record number
#num_fa the unique key
#FA_00001 the content of num_fa
#20190730140101 YYYYMMDDHHMMSS of timestamp
You can send to the "remote" every one of this dbf tables
on the other side (in the remote) a program reades this new dbf tables aDir := directory( "*.dbf")
for every element of aDir
USE FA
GOTO 1 or DBSEEK( FA_00001 )
and than
compare the fields of the record
bye
Marco Boschi
info@marcoboschi.it
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: how to update a remote DBF

Post by Otto »

Hello Marco,
thank you. How do you send the DBF file.
Best regards
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
User avatar
MarcoBoschi
Posts: 925
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

Re: how to update a remote DBF

Post by MarcoBoschi »

it all depends on scenario
- ftp
- mail (zip attached)
- copy if you are mapped
Marco Boschi
info@marcoboschi.it
audisys
Posts: 36
Joined: Wed Apr 18, 2007 6:01 pm
Location: Cartagena - Colombia

Re: how to update a remote DBF

Post by audisys »

use harbour netio, it works very well.

http://harbourlanguage.blogspot.com/201 ... netio.html

Regards,
José David Angulo
Auditoria y Sitemas Ltda.
Cartagena Colombia
User avatar
Massimo Linossi
Posts: 474
Joined: Mon Oct 17, 2005 10:38 am
Location: Italy

Re: how to update a remote DBF

Post by Massimo Linossi »

Hi Otto.
You can use remote command with powershell. Here is a MS documentation https://docs.microsoft.com/en-us/powers ... wershell-6
User avatar
cnavarro
Posts: 5792
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: how to update a remote DBF

Post by cnavarro »

C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
hmpaquito
Posts: 1200
Joined: Thu Oct 30, 2008 2:37 pm

Re: how to update a remote DBF

Post by hmpaquito »

Muy buena la referencia Cristóbal al LogRdd, pero creo que al LogRdd le hace falta un campo que no sea el Recno() (sensible al PACK) para referenciar los registros.
En todo caso, obviando el PACK, es una solución que me parece muy buena y que nos puede permitir hacer facilmente un sincronizador de tablas.

También grabaría en el LogRdd la fecha y la hora pensando en sincronizar desde varios origenes.
User avatar
cnavarro
Posts: 5792
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: how to update a remote DBF

Post by cnavarro »

hmpaquito wrote:Muy buena la referencia Cristóbal al LogRdd, pero creo que al LogRdd le hace falta un campo que no sea el Recno() (sensible al PACK) para referenciar los registros.
En todo caso, obviando el PACK, es una solución que me parece muy buena y que nos puede permitir hacer facilmente un sincronizador de tablas.

También grabaría en el LogRdd la fecha y la hora pensando en sincronizar desde varios origenes.

Bueno, graba el Recno porque así está definido en ese ejemplo, pero lo que grabas es lo que tu definas en cada caso
Well, record the Recno because that's how it is defined in that sample, but what you record is what you define in each case

Por cierto, también hay otro RDD interesante nativo de Harbour: ARRAY RDD
By the way, there is also another interesting RDD native to Harbour: ARRAY RDD
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: how to update a remote DBF

Post by Otto »

Hello,
thank you all.
I think with mod harbour this becomes an interesting.
If we want to update our DBF files on the webserver we need some kind of database server.
Best regards
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
User avatar
cnavarro
Posts: 5792
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: how to update a remote DBF

Post by cnavarro »

Otto wrote: If we want to update our DBF files on the webserver we need some kind of database server.
Otto
Please explain me why
Security ?, integrity ?, .....
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: how to update a remote DBF

Post by Otto »

Dear Cristobal,
I mean for data exchange between desktop and web.
For example if you use web for reports you have to upload data. FTP is a problem as you need firewall setup on client side.
I know we can use SQL but I would like to stay with DBF files.
Best regards
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
User avatar
Maurizio
Posts: 705
Joined: Mon Oct 10, 2005 1:29 pm
Contact:

Re: how to update a remote DBF

Post by Maurizio »

Ciao Otto
I use this system, simple and functional
Client side --> DBF database
Server side --> Mysql

You can keep both tables up to date without problem, errors of FTP

delegate everything to mysql

Maurizio
www.nipeservice.com
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: how to update a remote DBF

Post by Otto »

Hello Maurizio,
thank you for your help.
This is what I do right now.

But now 2019 we have mod harbour.
Have you installed mod harbour. It is so great.


I would like to use DBF also on the web.
Easier to handle - for small databases DBF is faster. More flexible (DBU vs myPHPAdmin ). No need for SQL server - also if it is free.

Maybe ODBC or winsock is an option.
Do you know if I can upload a dbf file with http in silent mode. FTP would be enough for my purpose. But FTP needs to be allowed on customer side.

Best regards
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
Post Reply