I am trying to set an access app using a SQLite DB.
Nothing fancy:
Visitor comes in,
RFID badge read by the app,
Add a new record in the DB (id_people, Date and Time)
I placed the DB as a property in the app as I have 2 windows and I want to access the DB in each (one for maintenance and set up and one as UI)
My question is regarding the DB connection. Would you open the db and connect to it in the app open event or would you trigger the open and connect every time a visitor presents a badge and close afterward?
J’adore l’analogie avec la porte ouverte. C’est d’autant plus parlant qe la porte de ma grange vient de s’ouvrir violemment avec un super coup de vent
Je vai faire comme çà donc. De toute façon comme j’apprend si ça fonctionne c’est bien on verra l’optimisation après.
i had sub class this SQLiteDatabase and create the object at need in a method.
Public Sub Constructor()
// Calling the overridden superclass constructor.
Super.Constructor
Self.DatabaseFile = File()
Self.Connect
End Sub
Public Sub Destructor()
Self.Close
End Sub
Public Function File() As FolderItem
Var f As FolderItem = SpecialFolder.Documents.Child("Database").Child("MyDB.Xojo.sqlite")
System.DebugLog f.NativePath
Return f
End Function