Sub CreateDB
Dim strSQL As String
Try
DB.Initialize(DBFileDir, DBFileName, True)
strSQL = "CREATE TABLE `DBInfo` ("
strSQL = strSQL & " `APP_Version` INTEGER,"
strSQL = strSQL & " `DB_Version` INTEGER )"
DB.AddNonQueryToBatch(strSQL, Null)
strSQL = "INSERT INTO `DBInfo` ("
strSQL = strSQL & " `APP_Version`,"
strSQL = strSQL & " `DB_Version` )"
strSQL = strSQL & " VALUES (?, ?)"
DB.AddNonQueryToBatch(strSQL, Array(Application.VersionCode, DB_VERSION))
Dim SenderFilter As Object = DB.ExecNonQueryBatch("DB")
Wait For (SenderFilter) DB_NonQueryComplete (Success As Boolean)
Log("DB.ExecNonQueryBatch('DB'): " & Success)
If Success Then
DB.Close
Else
strError = "Fail to create database"
If strMessage <> "" Then
strMessage = strMessage & CRLF & strError
Else
strMessage = strError
End If
End If
Catch
LogColor("[Starter] CreateDB: " & LastException.Message, Colors.Red)
strError = "Fail to create database"
If strMessage <> "" Then
strMessage = strMessage & CRLF & strError
Else
strMessage = strError
End If
End Try
End Sub