Lazarus, how to bypass the limit on the number of active datasets lazarus / 16-Databases ---------------------------------------------------------------------- essence-ciel · 2024-01-08 23:15 Hello everyone and best wishes for 2024, I'm migrating my self writen professional application from Delphi 12 + FireDac + Sqlite, which works on a database containing 60 tables, to Lazarus 3.00 + ZeosLib + Sqlite and I'm coming up against a limitation on the number of Datasets open at the same time. With Delphi, opening all 60 tables at the start of the program poses no problem, but not with Lazarus. This is why I get an error message. In fact, I often have to switch from one table to another to add an item or check a data, and sometimes switch again to another table (so 3 levels of pages displayed with as many tables open), for 6 product types. I asked this question a few months ago and was told to open and close the tables each time. So I went back to the program and tried to modify it, but in spite of everything I regularly get the message: "Operation cannot be performed on an inactive dataset". Most of my pages work fine, but one of them that's supposed to be working on always gives me the same error, and I've been trying for days in vain to get out of it. Isn't there a way of opening all 60 tables at once and switching from one to another without a hitch? Sincerely, ---------------------------------------------------------------------- rvk · 2024-01-08 23:23 Quote from: essence-ciel on January 09, 2024, 12:15:38 am..., but in spite of everything I regularly get the message: "Operation cannot be performed on an inactive dataset". That seems like a programming problem. Try to make a test program where you create and open 70 datasets and see if the same error occurs. Also show the error if the dataset can't be opened (because that is the error you want to catch). Now you just catch the error of an operation on a closed dataset. (If the number of datasets would be a problem I would expect a different error) ---------------------------------------------------------------------- Joanna · 2024-01-09 00:48 Also It wouldn’t be a bad idea to check if dataset is active before trying to use it  With sql related controls it’s harder to trance errors once a crash has occurred so best to check it while you are still in your pascal code . ---------------------------------------------------------------------- marcov · 2024-01-09 10:14 Quote from: essence-ciel on January 09, 2024, 12:15:38 amThis is why I get an error message. So.... which one ? Maybe we can search in the source for it. ---------------------------------------------------------------------- rvk · 2024-01-09 11:27 Quote from: marcov on January 09, 2024, 11:14:25 amQuote from: essence-ciel on January 09, 2024, 12:15:38 amThis is why I get an error message. So.... which one ? Maybe we can search in the source for it. I guess this one: Quote from: essence-ciel on January 09, 2024, 12:15:38 amI asked this question a few months ago and was told to open and close the tables each time. So I went back to the program and tried to modify it, but in spite of everything I regularly get the message: "Operation cannot be performed on an inactive dataset". But that's a programming problem. The dataset is inactive and you need to show an error for WHY the dataset is inactive (and why setting it active fails). ---------------------------------------------------------------------- essence-ciel · 2024-01-09 23:29 Thanks for all your suggestions, I'll dive back into the code and check the "OPEN/CLOSE" of each screen.