I am developing a program with an sqlite database. I have noticed when I import a fresh database file there is often a "Mal-formed database" error in the logs.
It seems I can cure this by deleting the db-wal and db-shm files (in the same folder as the database file).
Am I safe to code for this in the final program (code below)?
It seems I can cure this by deleting the db-wal and db-shm files (in the same folder as the database file).
Am I safe to code for this in the final program (code below)?
Import Database:
Dim f As String = fc.ShowOpen(MainForm)
If f <> "" Then
If File.Exists(File.DirData("PPAServer"),"WPP6.db-wal") Then
File.Delete(File.DirData("PPAServer"),"WPP6.db-wal")
End If
If File.Exists(File.DirData("PPAServer"),"WPP6.db-shm") Then
File.Delete(File.DirData("PPAServer"),"WPP6.db-shm")
End If
File.Copy(fc.InitialDirectory,"/wpp6.db",File.DirData("PPAServer"), "wpp6.db")
fx.Msgbox(MainForm,"Fresh Database Imported." & CRLF & "Restart Server.", "Done")
End If
Catch
fx.Msgbox(MainForm,"Error Importing Database!", "Oops")
Log(LastException)
End Try