SubName: DBTableExists
Author: "LucaMs"
Description: checks if a table exists in a SQLite database
Code:
Dependencies: None
Tags: Table, Tables, Database, DB, SQLite
("on demand ")
Author: "LucaMs"
Description: checks if a table exists in a SQLite database
Code:
B4X:
Public Sub DBTableExists(DB As SQL, TableName As String) As Boolean
Dim Result As Boolean = False
Dim Cur As Cursor
Try
Cur = DB.ExecQuery("SELECT name FROM sqlite_master WHERE type='table' AND name = '" & TableName & "'")
Result = (Cur.IsInitialized AND Cur.RowCount = 1)
Catch
Log("DBTableExists failed." & CRLF & LastException.Message)
End Try
Return Result
End Sub
Dependencies: None
Tags: Table, Tables, Database, DB, SQLite
("on demand ")