db_ver = "0.6"
'Log(DateTime.Time(DateTime.Now))
'Database hasn't been copied to read/write area
If File.Exists(File.DirInternal,"the_database.db") = False Then
File.Copy(File.DirAssets,"the_database.db",File.DirInternal,"the_database.db")
Else
'Database is in the read/write area, check the db_ver matches the app_ver
If VersionLabel.Text <> db_ver Then
ListViewSaveFavs.Initialize("ListViewSaveFavs")
Dim number_of_favs As Int
number_of_favs = 0
If SQL1.IsInitialized = False Then
SQL1.Initialize(File.DirInternal, "the_database.db", True)
End If
'DB version is greater than the app version, we need to store favourites, update the DB and restore favourites
'code excerpt removed
'remove the current database file
File.Delete(File.DirInternal,"theolympics.db")
'put the new database file in place
File.Copy(File.DirAssets,"the_database.db",File.DirInternal,"the_database.db")
SQL1.Initialize(File.DirInternal, "the_database.db", True)
'put the favourites back in the database
'code excerpt removed
End If
End If
If SQL1.IsInitialized = False Then
SQL1.Initialize(File.DirInternal, "the_database.db", True)
End If