| View previous topic :: View next topic |
| Author |
Message |
diktyo Guest
|
Posted: Fri Dec 30, 2005 5:43 pm Post subject: Opening and Closing Tables |
|
|
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
|
Posted: Fri Dec 30, 2005 7:44 pm Post subject: Re: Opening and Closing Tables |
|
|
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
|
Posted: Sat Dec 31, 2005 8:37 am Post subject: Re: Opening and Closing Tables |
|
|
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
|
Posted: Sat Dec 31, 2005 12:59 pm Post subject: Re: Opening and Closing Tables |
|
|
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 |
|
 |
|