I'm relatively new to Xojo, databases, and OOP in general. I'm creating a Windows Desktop app and using a SQLite database. I can connect to the database and create a recordset. Can also create and update records so far. What I'm not clear on is how to handle the database connection(s) and recordsets properly along the lines of OOP and database interactions in general. For example, I have just a single database and many different forms that will display/use various records. I'll be creating new records, editing records, deleting records on the forms. Here are my questions:
- Do I need to just connect to the database once in my application (connection remains active?) OR make a connection each time I need to perform a database CRUD task or to generate a recordset? Would I make a database connection when each form opens (Load)?
- Do I need to close the database connection and/or recordset after each CRUD task?