Ok so every time i run my app it creates an empty database and then one that is used for the stuff i need. what i would like to do is have it create one but only after I have selected the player one name and player two name (Which is lower in the code) and then name it based off them two names. I have tracked it down to the two lines where I have an "---->" in the code below
Both lines create a database but if I remove the first line the app crashes.
So my question is, Is there a way to have it only create the one database and rename it to what i want after in code???
Side note, The ----> is not in the actual code!
B4X:
If FirstTime Then
---->sql1.Initialize(File.DirDefaultExternal, DateTime.GetMonth(DateTime.Now) &"."& DateTime.GetDayOfMonth(DateTime.Now) &"."& DateTime.GetYear(DateTime.Now) & " " & DateTime.TIME(DateTime.Now) & ".db", True)
End If
sql1.ExecNonQuery("DROP TABLE IF EXISTS table1")
---->sql1.ExecNonQuery("CREATE TABLE table1 (Name TEXT, Makes INTEGER, Misses INTEGER, Defensive INTEGER, Left INTEGER, MOB INTEGER, Dead INTEGER, Error INTEGER, OnBreak INTEGER, BNR INTEGER, Winner TEXT, GamePlayed INTEGER)")
Both lines create a database but if I remove the first line the app crashes.
So my question is, Is there a way to have it only create the one database and rename it to what i want after in code???
Side note, The ----> is not in the actual code!