PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV Mobile 2024 → HCopyFile for local mobile databases
HCopyFile for local mobile databases
Started by Mike Stewart, Feb., 09 2017 6:52 PM - 2 replies
Posted on February, 09 2017 - 6:52 PM
I seem to be on here every day lately... for which I apologise

Spent a day so far researching different angles on this one. I want to create a mechanism where I can copy the database files from one user to another (this is for a one off setup operation). The files themselves will be put into a zipfile and transferred to another device using onedrive. I am trying to make this as universal as possible across the mobile platforms.

When I have tried to use HCopyFile using the following

HCopyFile(HListConnection(,fSeparator(fCurrentDir()+"/copies/",fSeparatorPlatform)+"current_user.fic","","current_user.fic")


I can not find a method to establish where the files are kept on the device. I have tried various properties of the file. I have nothing..
Posted on February, 09 2017 - 10:59 PM
Hi Mike

to know where your files are, you can use MyFileName..Directory

However, according to the help, hcopyfile can be used to:
Copies a HFSQL data file (.fic, .ndx, .ftx and .mmo files if they exist):
from the HFSQL server to the server (to perform a backup for example).
from the HFSQL server to the client (to perform a local backup for example).
from the client to the HFSQL server (to update the data files for example).
from a HFSQL server to antoher HFSQL server.

And it seems to me that you are trying to copy from client to client,
which is not supported. If Im' correct, then you need to use fcopyfile
instead.

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

Ready for you: WXShowroom.com, WXReplication (open source) and now WXEDM
(open source)

More information on http://www.fabriceharari.com

Le 2/9/2017 à 12:52 PM, Mike Stewart a écrit :
I seem to be on here every day lately... for which I apologise

Spent a day so far researching different angles on this one. I want to
create a mechanism where I can copy the database files from one user to
another (this is for a one off setup operation). The files themselves
will be put into a zipfile and transferred to another device using
onedrive. I am trying to make this as universal as possible across the
mobile platforms.

When I have tried to use HCopyFile using the following
HCopyFile(HListConnection(,fSeparator(fCurrentDir()+"/copies/",fSeparatorPlatform)+"current_user.fic","","current_user.fic")



I can not find a method to establish where the files are kept on the
device. I have tried various properties of the file. I have nothing..
Posted on February, 10 2017 - 7:32 PM
Thanks Fabrice

Unfortunately though MyFileName..Directory doesn't work for Android. WHat has worked though is the following.
zipCreate("DBArchive", fSeparator(fCurrentDir()+"/"+DateToString(DateSys(),"YYMMDD")+"ESPThinking.zip",fSeparatorPlatform))

sF is string =fListFile(fDataDir()+["/"]+"*.*")
FOR EACH STRING sNum OF sF SEPARATED BY CR
zipAddFile("DBArchive",sNum)
END
zipClose("DBArchive")