Results 1 to 4 of 4

Thread: Simple database question.

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2000
    Posts
    299

    Question

    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

  2. #2
    Fanatic Member Ianpbaker's Avatar
    Join Date
    Mar 2000
    Location
    Hastings
    Posts
    696

    Talking

    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
    Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!

  3. #3
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105
    There is overhead associated with opening a database (time and memory). To open a database more than once is wasteful of both.

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2000
    Posts
    299

    cheers guys

    Thats what i thought as well, but there are some that think otherwise and i thought i'd get an outside opinion.
    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width