Sub Service_Create
'This is the program entry point.
'This is a good place to load resources that are not specific to a single activity.
dbFileName = "RecentFilesCP.db"
initRecentDatabase(File.DirRootExternal, dbFileName)
fileNameSel = "dummyFileName"
pathNameSel = "dummyPath"
addOrUpdateFile(fileNameSel, pathNameSel, (pathNameSel & "\" & fileNameSel), "n", 1000)
...
'======================================================================================================
private Sub initRecentDatabase(path As String, dbName As String) As Boolean
If File.Exists(path, dbName) Then
Try
sqlRecent.Initialize(path, dbName, False)
' logOn, setJournal, integrityCheck, doFullCheckPoint, setAutoCheckPoint) As Boolean
If checkRecentFilesDB(True, "WAL", True, True, -3) = False Then
Return False
End If
Catch
Log(LastException)
Return False
End Try
Else
Try
sqlRecent.Initialize(path, dbName, True) '********************** ERROR 1 *************************
Catch
Log(LastException)
Return False
End Try
Try
'Create the recent files table
'createRecentTable
SQLInit
' logOn, setJournal, integrityCheck, doFullCheckPoint, setAutoCheckPoint) As Boolean
If checkRecentFilesDB(True, "WAL", False, False, -3) = False Then
Return False
End If
Catch
Log(LastException)
Return False
End Try
End If
Return True
End Sub