Implementing a navigation set of buttons for SQLite in API2

APIé:I’ve made searches and I get to this conclusion:

a “SELECT * TABLE” have to be done and keep until the window close (what if I add a Record or Modify one ?)

The next simple step would be to (desing idea, not real code)

SELECT FROM RS WHERE ID=Integer

but I do not know how to concatenate the two parts of this command.

Nothing at sqlite.com/.org,
SQL SELECT Statement
SQL SELECT Statement
SQLite SELECT Statement

Do you provide data base contents navigation in your SQLite driven application ? If so, how ?

Xojo 2025r4.2
Sequoia 15.4
MacBook Pro 13" m1

The ‘SELECT * FROM TABLE’ gives you a RowSet, which remains valid until discarded. Adding/modifying a record does not change that RowSet.

The SELECT gives you a RowSet and you then iterate through that, so I’m not sure what you mean by ‘SELECT FROM RS WHERE ID=Integer’. You should be doing ‘SELECT * FROM TABLE WHERE ID=integer’ and then using the resulting RowSet.

When I add a new record, I reload the listbox with a new SELECT. Then I find the newly added record in the listbox, select it and scroll to it.

How work SELECT. At the first message, I put 4 different URLs that explain in detail the mos common use of SELECT to avoid getting a 5 y/o explanation about SELECT. Some lurkers may ler-arn something, but in my case, I already read that… long time ago to create version 1 of that software, in 2012-2013. Now we are using API 2, things are a bit different.

So, you never navigate (as a user) thru your data base. I do not want to talk about filemaker because I do not used it since the end of the 80s, but this was perfectly possible in View by Record to read since Record n, all Records until Record n = i.
Just what you can do manually with a Rollodex.

I can also use a progress bar that allows to go to Record x (the record the value at click).

I can also add a search by First Name / Last Name to go to this person because I have to update its Record.

The software have a List View (one window) to have a fast look and a Record View (another window) to read all the Record information.

Is it clear now ?

Same here for the List View.

But the question is about the Record View.

A window that display all Columns for one Record.

I want to be able to navigate there.

It really isn’t different than before. The only difference is RowSet and SelectSQL. Where are you getting hung up?

The first of those is a typing error on your part. Remove the /.org and try again. At sqite.com (actually sqlite.org) you can find the entire SQL syntax understood by SQLite - including SELECT - Query Language Understood by SQLite. I always go to sqlite.org, where you have a reference (not tutorial) website created by the sqlite devs. Better answers there.

In my case, these are not databases, they are mailboxes. Implemented as an SQLite database, but the user doesn’t care about that. The emails are shown in a listbox and the user can select one to see its contents. At least one of my users has around 1000 mailboxes (I don’t understand how he keeps track of them all).

Looks like this:

The mail selected by the user is then displayed below. The user can click on listbox headers to sort the displayed mailbox by that column (done by reloading the entire listbox and having SQLite presenting the results in the right order via an ORDER BY).

A separate search facilty allows the user to search for emails matching a number of criteria across one or many mailboxes.

I do not ant to do that.

Our difference here is your user have the list of mail (easy to do), my user do not see the list of people and the navigation is done here.
Or he must close the wRecord window to search in the wLMist window its entry, then double click to open that entry in wRecord.

Yes, it is that hard to understand.

Galileo “and it revolve !”

Assuming your wLMist window contains the listbox that you populated from the query, create a method(s) that you can call from wRecord to return the next or previous ID from the listbox. Increment/Decrement listbox.SelectedRowIndex, retrieve the ID from that row and return it. In wRecord, run a query to retrive just that one record.

That is exactly what I am doing now.

Go to a window, choose, double-clik, Opens another window.
NB. Each entry in the list view have its Record ID in Row Tag.
So, In Record View I ask for this Record from the Data Base.

ListBox is here only for display (yes, its a displayer).
`

How many times will you do that before sending the computer thru the window ?

Then you are doing it correctly. There is no overhead or lag. It should be seamless. The user won’t notice at all and your app will experience no ill effects.

That’s not a problem unless you’re doing something wrong. In which case, post some code so we can tell you what you’re doing wrong.