PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV Mobile 22 → HCopyFile for local mobile databases
HCopyFile for local mobile databases
Débuté par Mike Stewart, 09 fév. 2017 18:52 - 2 réponses
Posté le 09 février 2017 - 18:52
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..
Posté le 09 février 2017 - 22:59
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..
Posté le 10 février 2017 - 19:32
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")