Experimenti with SQLite

  1. 3 weeks ago

    Armando S

    Apr 26 Parma, Italy

    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

    @Edwin L 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.

    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.

  2. 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.

  3. Armando S

    Apr 26 Parma, Italy

    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

  4. brian f

    Apr 26 Pre-Release Testers, Xojo Pro Chilly California

    @Armando S

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

  5. Armando S

    Apr 26 Parma, Italy

    Super. Thanks a lot

  6. Armando S

    Apr 26 Parma, Italy

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

  7. Tim S

    Apr 26 Answer Canterbury, UK

    @Edwin L 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.

    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.

  8. Armando S

    Apr 26 Parma, Italy

    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!"

or Sign Up to reply!