the Emulator can not copy DB file from assets to internal or SDcard
1.
At first removed the old Emulator, then created a new Emulator and attached to it new hardware - the CD card, thank you, klaus! :sign0013:
2.
But the new Emulator can not copy DB file from assets to SDcard as before:
Sub CopyDBFromAssets
Dim TargetDir As String
If File.ExternalWritable Then TargetDir = File.DirRootExternal ' Else TargetDir = File.DirInternal
If File.Exists(TargetDir, DBFileName) = True Then
File.Delete(TargetDir, DBFileName)
Msgbox(" DB Deleted!! "&TargetDir,"attention!!!")
End If
If File.Exists(TargetDir, DBFileName) = False Then
File.Copy(File.DirAssets, DBFileName, TargetDir, DBFileName)
End If
End Sub
The Emulator find the DB file in DirRootExternal and DB file is deleted from the card, it seems to me any piece of file was copied, but not completely.
Size of DB file is 2.2MB = 2286KB
Size of SD card is 16M
ERROR occurs at line:
File.Copy(File.DirAssets, DBFileName, TargetDir, DBFileName)
where TargetDir = File.DirRootExternal
Please look at the attached file pic.jpg
I tried with TargetDir = File.DirInternal but get the same error.
Where there can be a mistake in my codes ? :sign0085: