-
When should I open and close a connection from the DataEnvironment when accessing an MDB file?
Should I open it at the start of the program and leave it open until it terminates, or should I open it before every DB operation (add record , delete record etc...)?
-
Depends??????????
Ok we generally connect the database right at the start of an application. That is the db not a recordset.(Microsoft are incrediably bad in how they handle record locking. Logking a whole page...give me a break...you should lock a single record like a good database). Anyway coz of how MS handle record locking in multi user environments we open the actual recordset just prior to updating or displaying.
Also depends on number of users....mdb can support up to about twenty or so till it gets flacky...
Anyway close the db connection at end of app. Ya get incrediable server traffic if constantly opening and closing a db during an applications run time.
Remember every time you connect/disconnect to a mdb there is the possibility of data corruption, therefore keep it to a minimum.