I saw in an old project (written using Real Studio, in 2011-2012) a check against db.ErrorMessage saying something like:
If db.ErrorMessage = ""table Photo_ID already exists" Then…
(or it comes from my SQLite for dummies paper book; I do not have it handly)
But, I checked that using Xojo 2015r1 (where the project has this old code) in the debugger, and there is no error (Error 0, no Error string). *
I wasted hourless time with that Legacy code, until I removed it.
The only place I can think to, where get this at the original writting time was in the debugger. I recall using it widely to understand how SQLite was working, then.
NEVER trust in a informational message as a source of specific data. A new version of the underlying engine could just change the message and what you did just breaks. (As Xojo got broken because they extracted macOS version from a string that Apple said “don’t try it” and a patch info put there recently caused havoc). This message is used for information only. Error codes, if defined and documented for some use, could be used instead. BUT…
I think you are just trying to achieve something just covered using proper SQL. SO…
Function tableExists (dbh As SQLiteDatabase, tablename As String) As Boolean
Var sql As String
sql = "select 1 from " + tablename
Try
Call dbh.SelectSQL (sql)
Return True
Catch e as DatabaseException
Return False
end try
End Sub