BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Opening and Closing Tables

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (Desktop)
View previous topic :: View next topic  
Author Message
diktyo
Guest





PostPosted: Fri Dec 30, 2005 5:43 pm    Post subject: Opening and Closing Tables Reply with quote



What is good practice in the following senario :

A desktop database with a couple of users.
The tables are on a datamodule.

Do I have to open and close the tables during the
flow of the program or should I open them at the start
and leave them open until program finishes.


Is there a problem in the following (table1 on datamodule1)

table1.Open;
blah;
blah;
blah;
table1.Post;
table1.Close;


when User1 gets to the bottom of the code and user2 is at
table1.Post ???


Thanks

Petros


Back to top
Bill Todd
Guest





PostPosted: Fri Dec 30, 2005 7:44 pm    Post subject: Re: Opening and Closing Tables Reply with quote



What database are you using?

diktyo wrote:

Quote:
What is good practice in the following senario :

A desktop database with a couple of users.
The tables are on a datamodule.

Do I have to open and close the tables during the
flow of the program or should I open them at the start
and leave them open until program finishes.

Most dataset components are associated with a single form. The most
common practice is to open the tables when you create the form and
close the tables when you free the form and/ or data module.

Quote:


Is there a problem in the following (table1 on datamodule1)

table1.Open;
blah;
blah;
blah;
table1.Post;
table1.Close;


when User1 gets to the bottom of the code and user2 is at
table1.Post ???

No.

--
Bill Todd (TeamB)

Back to top
diktyo
Guest





PostPosted: Sat Dec 31, 2005 8:37 am    Post subject: Re: Opening and Closing Tables Reply with quote



Bill, thanks for the answer.

I am trying out DBISAM and AbsoluteDB as file servers.

but...

if I have one datamodule isn't this same DM shared
by all users (same instance) ?
When I open and close tables ON THIS DM, doesn't
it affect the other users using the same DM?
(It is assumed I have a DM with all tables eg
Customer, Orders, Items etc. and it is "used" by
all forms in the App.)


Thanks

Petros

Back to top
Bill Todd
Guest





PostPosted: Sat Dec 31, 2005 12:59 pm    Post subject: Re: Opening and Closing Tables Reply with quote

diktyo wrote:

Quote:
if I have one datamodule isn't this same DM shared
by all users (same instance) ?
When I open and close tables ON THIS DM, doesn't
it affect the other users using the same DM?

No. A completely separate copy of your program is executing on each
user's PC.

Quote:
(It is assumed I have a DM with all tables eg
Customer, Orders, Items etc. and it is "used" by
all forms in the App.)

That is fine for small apps. You can open the tables when the app
starts and close them when the app terminates if you wish.

--
Bill Todd (TeamB)

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (Desktop) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.