Can anyone provide me with the file type details for an SQLite database file?
I have looked in the File Type Set, but cannot see anything for a database.
I need to save a database file to the desktop, but can’t as I don’t know the file type details.
If Destination.Exists Then
source.CopyFileTo Destination
end If
IF DESTINATION.EXISTS THEN
This means if the file I wish to copy to is already there… yet you now say it is NOT already there… in which case how would you expect the COPYFILETO to ever execute???
Does that mean, that you debugged the software and the line
source.CopyFileTo Destination
is executed without any Error?
In that case the CopyFileTo doesn’t work like expected. The Reference says:
"“If Destination is a file and the file already exists, the copy is aborted. You need to delete the existing file first. If there is an error, the LastErrorCode property contains an error code.”
Ok, even though I do not see any little red bugs in the debugger, I have noticed that when I press the backup button - I am returned to the debugger, whereby I looked in the variables area at the bottom of the window - it says source nil
However - the folder called myFolder is definitely there, and it definitely contains the db file called myDb.db
Dim source As FolderItem = SpecialFolder.ApplicationData.Child("Snippet Data").Child("Snippets.db")
If source <> Nil Then
Dim Destination As FolderItem = GetSaveFolderItem(FileTypes1.SQLite,"Snippets.db")
if destination=nil then msgbox "BAD DESTINATION"
If source=NIL or not source.exists then msgbox "BAD SOURCE"
If Destination.Exists Then destination.delete
source.CopyFileTo Destination
if source.LastErrorCode > 0 then
MsgBox(Str(source.LastErrorCode))
end if
End If
Dave - just tried your code and when I run the app and press the backup button - the software just hangs.
Ahh - the close thing must be the problem - BUT why would it then copy perfectly if I pre-define the destination, but not if user defined? Just trying to learn