PDA

Click to See Complete Forum and Search --> : Simple database question.


But_Why
Jun 8th, 2000, 11:39 AM
In a program, in which many forms access the same access database, which is better:
a) Opening the database once globally and each form opens a different recordset (unless a global one is required)
b) Opening the database on each form, but declaring it a different variable name?

Can i have pro's and cons of both thanks?
Cheers

Ianpbaker
Jun 8th, 2000, 03:25 PM
Hi But_Why

If Many Forms are using the same database all of the time, it is best to open The database globally and close it when the app terminates. This is because if you keep on opening and closing the connection all the time it can slow down both your app and the database itself for other users. When making connections it takes quite alot of recources to open them. The only con to this is that if you are using a small RDBMS like access, if you have a lot of of active connection running at the same time it can also slow down the database.

Hope this helps

Ian

JHausmann
Jun 9th, 2000, 02:05 AM
There is overhead associated with opening a database (time and memory). To open a database more than once is wasteful of both.

But_Why
Jun 11th, 2000, 03:27 AM
Thats what i thought as well, but there are some that think otherwise and i thought i'd get an outside opinion.
Thanks