Results 1 to 8 of 8

Thread: [RESOLVED] Loading and Unloading DB

  1. #1

    Thread Starter
    Addicted Member Quizton's Avatar
    Join Date
    Dec 2005
    Location
    VB Forums
    Posts
    209

    Resolved [RESOLVED] Loading and Unloading DB

    I am a bit confused on this matter, ATM I link my DB from the properties form and go that route
    Would it be better to Load and unload by code rather than do it on the menu. Will using it by properties menu cause problems later if I get a bit technical in my coding?VB 6.0
    Thanks

  2. #2

    Thread Starter
    Addicted Member Quizton's Avatar
    Join Date
    Dec 2005
    Location
    VB Forums
    Posts
    209

    Re: Loading and Unloading DB

    Re: When should i open and close database

    --------------------------------------------------------------------------------

    Quote:
    Originally Posted by sajankk
    my doubt is whether i should close the database in each operation or i can open the databse in the form load and close in the form unload.
    Answer By Hack:
    Yes, this is the way to go. Open it when the program starts, and close it when the program is existed. While the program is running, your database should remain open.



    This poses a question , Does linking with properties open and close for me or does it just stay open?

  3. #3
    PowerPoster abhijit's Avatar
    Join Date
    Jun 1999
    Location
    Chit Chat Forum.
    Posts
    3,228

    Re: Loading and Unloading DB

    Are you referring to a connection of the database?
    Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
    save a blobFileStreamDataTable To Text Filemy blog

  4. #4

    Thread Starter
    Addicted Member Quizton's Avatar
    Join Date
    Dec 2005
    Location
    VB Forums
    Posts
    209

    Re: Loading and Unloading DB

    Yes, whether it is better to connect by means of setting in the properties or just doing it all by code? the setting wich DB and opening and closeing

  5. #5
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Loading and Unloading DB

    Please read Database Problems in my signature for some assistance.

  6. #6
    PowerPoster abhijit's Avatar
    Join Date
    Jun 1999
    Location
    Chit Chat Forum.
    Posts
    3,228

    Re: Loading and Unloading DB

    The connection object is required througout the life of the application. So it should be opened on the first form load and then closed only at the end of the application.
    Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
    save a blobFileStreamDataTable To Text Filemy blog

  7. #7
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Loading and Unloading DB

    From your explanation I guess you are using Data Controls (ADODC or similar), in which case I can happily say get rid of them and never go back.

    They are restrictive at best, and can cause nightmares. I haven't checked, but I would be willing to bet that that none of our members who have written serious database applications use them - as code leaves you in control of what is going on.

    It takes a little bit of extra work to use code, but (IMO) the benefits outweigh this hugely.

    If you want to see an example of connecting purely by code, check out the ADO Tutorial in my signature.

  8. #8

    Thread Starter
    Addicted Member Quizton's Avatar
    Join Date
    Dec 2005
    Location
    VB Forums
    Posts
    209

    Re: Loading and Unloading DB

    Yes I have a long way to go lol But I will take your word for it
    and try to do all I can with code rather than controlls
    thanks again

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