Gambas one more example

I spent quite a bit of time with Gambas today. Mostly getting use to the documentation and lack thereof. Also knowing MS-Access/VB is both helpful and a hindrance. Trying to make Gambas do what I was sure they could do. And just plain forgetting things, For example I didn’t remember that you use Cstr to convert number to string.

So below…Do a Select depending on Radio Button selected. I added a few radio buttons before I found the ButtonBox. Then I couldn’t figure how to put the buttons on top of the control. I thought in MS-Access there was something like move forward or back. Once I figured that out I tried to move the ButtonBox, but the buttons didn’t move too. Finally figured out that I has to lasso or select everything then I could move the group. I think it was the same in MS-Access but I forgot. I haven’t figured out how do have no radio button selected, so I added a nothing button. Also I couldn’t figure out how to change form color. The GridView documentation says the control can handle millions of lines gracefully.

One stupid hang up I had was doing a simple select on the last name. I was getting no records. Did I forget how to do a simple SELECT? Was Gambas screwing up? No and no. I wasn’t getting any records from DB Browser for SQLite either. I Finally realized there were spaces at the end of the last name. I later changed the search to a state which is more logical than a last name search using Radio Buttons.

The search is a little slow but I think that has more to do with the Database and not Gambas. The database has a million records and state is not indexed. As you can see TX retrieved over 63,000 records.

So most of the time was spent figuring out little things. Nothing big. I learned a lot from this little example. Perhaps I should github it and include a small sample database to go along with it.

It took several seconds to return the results. The database has a million records. I assume it was filling 63431 Grid rows that took time. Because DB Browser for SQLite returned the rows in 600+ms. And probably less time from the command line. I had looked at Libreoffice Base recently which seems targeted at MS-Access users but found it very difficult to work with. Gambas on the other hand is very MS-Access like. It was fun!