how to update a remote DBF

how to update a remote DBF

Postby Otto » Tue Jul 30, 2019 8:55 am

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
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6330
Joined: Fri Oct 07, 2005 7:07 pm

Re: how to update a remote DBF

Postby hmpaquito » Tue Jul 30, 2019 9:03 am

hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: how to update a remote DBF

Postby MarcoBoschi » 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
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: how to update a remote DBF

Postby Otto » Tue Jul 30, 2019 12:55 pm

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
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6330
Joined: Fri Oct 07, 2005 7:07 pm

Re: how to update a remote DBF

Postby MarcoBoschi » Tue Jul 30, 2019 1:35 pm

it all depends on scenario
- ftp
- mail (zip attached)
- copy if you are mapped
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: how to update a remote DBF

Postby audisys » Tue Jul 30, 2019 1: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
audisys
 
Posts: 49
Joined: Wed Apr 18, 2007 6:01 pm
Location: Cartagena - Colombia

Re: how to update a remote DBF

Postby Massimo Linossi » Tue Jul 30, 2019 2: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
User avatar
Massimo Linossi
 
Posts: 498
Joined: Mon Oct 17, 2005 10:38 am
Location: Italy

Re: how to update a remote DBF

Postby cnavarro » Tue Jul 30, 2019 3: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
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: how to update a remote DBF

Postby hmpaquito » Tue Jul 30, 2019 4: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.
hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: how to update a remote DBF

Postby cnavarro » Tue Jul 30, 2019 6: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
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: how to update a remote DBF

Postby Otto » Tue Jul 30, 2019 6: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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6330
Joined: Fri Oct 07, 2005 7:07 pm

Re: how to update a remote DBF

Postby cnavarro » Tue Jul 30, 2019 7: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
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: how to update a remote DBF

Postby Otto » Tue Jul 30, 2019 8: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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6330
Joined: Fri Oct 07, 2005 7:07 pm

Re: how to update a remote DBF

Postby Maurizio » Wed Jul 31, 2019 6: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
User avatar
Maurizio
 
Posts: 824
Joined: Mon Oct 10, 2005 1:29 pm

Re: how to update a remote DBF

Postby Otto » Wed Jul 31, 2019 7: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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6330
Joined: Fri Oct 07, 2005 7:07 pm

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 48 guests