Sub FTP_DownloadCompleted (ServerPath As String, Success As Boolean)
Log(ServerPath & ", Success=" & Success)
If Success = False Then
Msgbox("Error updating: " & LastException.Message,"")
Log(LastException.Message)
Else
cursor1.Close 'Add this to close the cursor first. If there are more cursors, close them all before closing the SQL object.
SQL1.Close 'Add this to close the SQL object.
File.Delete(File.DirInternal,"mydb.db")
File.Copy(File.DirRootExternal,"mydb.db",File.DirInternal,"mydb.db")
SQL1.Initialize(File.DirInternal, "mydb.db", False)
Msgbox("Update completed.","MyApp Update")
End If
End Sub