|
-
Dec 21st, 2005, 02:26 PM
#1
Thread Starter
Addicted Member
[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
-
Dec 21st, 2005, 02:31 PM
#2
Thread Starter
Addicted Member
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?
-
Dec 21st, 2005, 02:36 PM
#3
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
-
Dec 21st, 2005, 02:40 PM
#4
Thread Starter
Addicted Member
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
-
Dec 21st, 2005, 03:23 PM
#5
Re: Loading and Unloading DB
Please read Database Problems in my signature for some assistance.
-
Dec 21st, 2005, 03:41 PM
#6
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
-
Dec 21st, 2005, 06:12 PM
#7
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.
-
Dec 21st, 2005, 10:43 PM
#8
Thread Starter
Addicted Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|