Page 1 of 2

how to update a remote DBF

Posted: Tue Jul 30, 2019 8:55 am
by Otto
Hello,
is it possible to update a DBF file on a remote system.
Thank you in advance
Otto

Re: how to update a remote DBF

Posted: Tue Jul 30, 2019 9:03 am
by hmpaquito

Re: how to update a remote DBF

Posted: Tue Jul 30, 2019 12:24 pm
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

Re: how to update a remote DBF

Posted: Tue Jul 30, 2019 12:55 pm
by Otto
Hello Marco,
thank you. How do you send the DBF file.
Best regards
Otto

Re: how to update a remote DBF

Posted: Tue Jul 30, 2019 1:35 pm
by MarcoBoschi
it all depends on scenario
- ftp
- mail (zip attached)
- copy if you are mapped

Re: how to update a remote DBF

Posted: Tue Jul 30, 2019 1:50 pm
by audisys
use harbour netio, it works very well.

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

Regards,

Re: how to update a remote DBF

Posted: Tue Jul 30, 2019 2:42 pm
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

Re: how to update a remote DBF

Posted: Tue Jul 30, 2019 3:17 pm
by cnavarro

Re: how to update a remote DBF

Posted: Tue Jul 30, 2019 4:18 pm
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.

Re: how to update a remote DBF

Posted: Tue Jul 30, 2019 6:18 pm
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

Re: how to update a remote DBF

Posted: Tue Jul 30, 2019 6:26 pm
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

Re: how to update a remote DBF

Posted: Tue Jul 30, 2019 7:15 pm
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 ?, .....

Re: how to update a remote DBF

Posted: Tue Jul 30, 2019 8:46 pm
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

Re: how to update a remote DBF

Posted: Wed Jul 31, 2019 6:47 am
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

Re: how to update a remote DBF

Posted: Wed Jul 31, 2019 7:25 am
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