Experimenti with SQLite

Hello,
I’m trying to understand SQLite and I wrote a very basic database based on the BaseballLeague example (see link).
It loads the ListBox window with the correct columns but when I click on the AddButton, which is called “Aggiunta” in my program, I get an error I’m unable to identify. For sure I miss something but I don’t know what.
Can anybody help?

Thank you

https://we.tl/t-FnI8jpFH2X

I was looking at your SQLite file. It looks like you have the Database file set up but there is no Tables inside it.

When you do the Add Record to the Database, it crashes as there is no table to insert the records into.

Think of a Database File as a Container and within that Database File are Tables which contains your records.

Thank you Edwin.
How does it find the column names then?
I created the Test.sqlite thru Xojo and I thought I created the table and columns as well by clicking on the specific buttons.
One more question: how do you open and edit a xx.sqlite file?

Thank you

@Armando SORBI

Hers is a sqlite browser and can also be used for edits DB Browser for SQLite

Super. Thanks a lot

I fixed the SQLite file but if I run the program it still stops at line 9 of button “Aggiunta”

[quote=434070:@Edwin Lau]I was looking at your SQLite file. It looks like you have the Database file set up but there is no Tables inside it.

When you do the Add Record to the Database, it crashes as there is no table to insert the records into.[/quote]
That won’t cause a crash. The SQLexecute will fail and return an errorcode.

  1. Why do you force the user to open the DB before anything else. You should do that yourself. When I ran it the first time I got a NilException at line 9 in “Aggiunta”.

  2. Nowhere are you creating the required tables in the database.

I was just following a webinar example. I’m trying to get the feeling for SQLite and it needs to be refined, of course.
I found the problem, though: I was not loading the DB at all. I’m slowly coming to it.

Thanks everybody, anyway and, as Terminator used to say: “I’ll be back!”