Page 1 of 1

Automatic data download

Posted: April 16th, 2021, 6:04 am
by pinkcity
Hi,

Data download from the FTP server, Can this process will be an automatic process. can we have a script, that we use in the program and data will automatically download on the laptop?

Regards,

Re: Automatic data download

Posted: April 16th, 2021, 2:19 pm
by aaronw
Sure, I've written a batch app to upload data before (see below). You'd just need to modify it and use Windows scheduler to run the PFF.
https://en.wikipedia.org/wiki/Windows_Task_Scheduler
PROC UPLOAD_LOOKUP_DATA_FF

if not syncconnect(CSWeb, serverURL) then
    errmsg
("Error connecting to CSWeb server: %s", serverURL);
else

    when syncdata
(PUT, ASSIGNMENTS_DICT);
         
true  -> errmsg("Synced assignments (%d cases) to %s", countcases(ASSIGNMENTS_DICT), serverURL);
         
false -> errmsg("Error syncing assignments to %s", serverURL);
   
endwhen;

   
syncdisconnect();

endif;

Re: Automatic data download

Posted: April 20th, 2021, 5:23 am
by pinkcity
Thanks, but I want to download it from the FTP server. Can you please give some example and help

Regards,

Re: Automatic data download

Posted: April 20th, 2021, 8:19 am
by Gregory Martin
The sync functions are the same once you've connected. Instead of using CSWeb in the syncconnect call, you can connect using syncconnect(FTP, ...).

Another option is to use Data Viewer to download your data. When you do this, you'll get a .pff file that contains the information needed to update the data file. If you run this .pff, or add it to the Task Scheduler, you should be able to keep your data updated.