FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour how to update a remote DBF
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
how to update a remote DBF
Posted: Tue Jul 30, 2019 08:55 AM

Hello,
is it possible to update a DBF file on a remote system.
Thank you in advance
Otto

Posts: 1515
Joined: Thu Oct 30, 2008 02:37 PM
Re: how to update a remote DBF
Posted: Tue Jul 30, 2019 09:03 AM
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: how to update a remote DBF
Posted: Tue Jul 30, 2019 12:24 PM

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
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: how to update a remote DBF
Posted: Tue Jul 30, 2019 12:55 PM

Hello Marco,
thank you. How do you send the DBF file.
Best regards
Otto

Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: how to update a remote DBF
Posted: Tue Jul 30, 2019 01:35 PM

it all depends on scenario
- ftp
- mail (zip attached)
- copy if you are mapped

Marco Boschi
info@marcoboschi.it
Posts: 49
Joined: Wed Apr 18, 2007 06:01 PM
Re: how to update a remote DBF
Posted: Tue Jul 30, 2019 01:50 PM

use harbour netio, it works very well.

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

Regards,

Jos茅 David Angulo

Auditoria y Sitemas Ltda.

Cartagena Colombia
Posts: 512
Joined: Mon Oct 17, 2005 10:38 AM
Re: how to update a remote DBF
Posted: Tue Jul 30, 2019 02:42 PM
Hi Otto.
You can use remote command with powershell. Here is a MS documentation https://docs.microsoft.com/en-us/powershell/scripting/learn/remoting/running-remote-commands?view=powershell-6
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: how to update a remote DBF
Posted: Tue Jul 30, 2019 03:17 PM
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 1515
Joined: Thu Oct 30, 2008 02:37 PM
Re: how to update a remote DBF
Posted: Tue Jul 30, 2019 04:18 PM

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.

Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: how to update a remote DBF
Posted: Tue Jul 30, 2019 06:18 PM
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
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: how to update a remote DBF
Posted: Tue Jul 30, 2019 06:26 PM

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

Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: how to update a remote DBF
Posted: Tue Jul 30, 2019 07:15 PM
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 ?, .....
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: how to update a remote DBF
Posted: Tue Jul 30, 2019 08:46 PM

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

Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Re: how to update a remote DBF
Posted: Wed Jul 31, 2019 06:47 AM

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

Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: how to update a remote DBF
Posted: Wed Jul 31, 2019 07:25 AM
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