It may be wise to use “if not exists” to check if such a table already exists, before trying to create it…
var datedujour As String = Format(DateTime.Now.Hour,"00")
Var sql as String = "CREATE TABLE " + datedujour + " (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, surname TEXT)"
db.ExecuteSQL(sql)
I would advise against creating one table for each day in real time …
better create a fixed table “events” with a field named “day_of_month” where you store the day
then it’s a question of filtering the display to select only the day you want.
it’s more “integrity friendly”
just my 2cts.
var datedujour As String = "table_"+Format(DateTime.Now.Hour,"00") // must start with letters
Var sql as String = "CREATE TABLE " + datedujour + " (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, surname TEXT)"
db.ExecuteSQL(sql)
As the user seem not being an expert, I guess you are correct. But things really depends on use case and design. I think that may have some real proper use case like rotating logs being created, and after backup, dropped… But as I said, I guess it is not the current case.
I’ve just realized that you can’t put a number in the name of an SQLite table! If this is true, I find it completely absurd!
Yes, I’m going to go back to a single table with a column named with the day.
Thank you all for your help…