I update my users’ databases from time to time, so I can add new features. So I made these, which I call when an update may be needed, to see whether the update is needed:
Sub columnExists (dbh As SQLiteDatabase, colname As String, tablename As String)
Var sql As String, reg As RowSet
sql = "select " + colname + " from " + tablename
Try
reg = dbh.SelectSQL (sql)
Return True
Catch e as DatabaseException
Return False
end try
end sub
and:
sub tableExists (dbh As SQLiteDatabase, tablename As String)
Var sql As String, reg As RowSet
sql = "select 1 from " + tablename
Try
reg = dbh.SelectSQL (sql)
Return True
Catch e as DatabaseException
Return False
end try
end sub
I implemented Ivan advice (a bit lazy / I need to use the application right now); I added the default value(s) at the same time, so the Field is not empty).
Tim: I saved this page for future use. I love your idea as a supplementary to a file version field.