PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → [wm20-android]Receiving a database via FTP and can't use it.
[wm20-android]Receiving a database via FTP and can't use it.
Iniciado por guest, 28,dic. 2015 09:56 - 1 respuesta
Publicado el 28,diciembre 2015 - 09:56
Hi,

I was loading database files via FTP in the database directory (/.../com.../databases). The transfer of the files worked great, i can see them via Total Commander in the directory. But the app can't work with these databases. Any idea how to solve this?

regards Patrick
Publicado el 29,diciembre 2015 - 16:34
Hello,

We use following code to Restore Database File in our Mobile App:

// Summary: // Syntax: //RestoreDBFile ( is string) // // Parameters: // RestoreDBPath (UNICODE string): // Return Value: // None // // For instance: // Indicate an example. // PROCEDURE RestoreDBFile(RestoreDBPath is string) sFileExtension is string sFileName is string sFileExtension = ExtractString(RestoreDBPath,1,".",FromEnd) IF Upper(sFileExtension) = Upper("db") THEN sFileName = ExtractString(RestoreDBPath,1,"/",FromEnd) HCloseConnection(RestoreDBPath) IF fCopyFile(RestoreDBPath,CompleteDir(fDataDir()) + "sa.db") = True THEN Info("Database Backup completed without any Errors") EndProgram() ELSE Error("Cannot Restore selected DB",ErrorInfo(errFullDetails)) EndProgram() END ELSE Error("Invalid File Selected") END
HTH

Yogi Yang