Solved

close databases

Posted on 1998-08-26
2
126 Views
Last Modified: 2010-04-30
If I use the same table from the same database in to distinct forms that don't work beetwen them should I close the databases and tables when I unload one of them , and should I open the databases everytime I load one of them?
And Where should a database must be openned? In the main form, in a separate module, in a function of the form?
I hope you can answer all off this questions.

Thanks so much
Alberto
0
Comment
Question by:asimoes
  • 2
2 Comments
 
LVL 4

Accepted Solution

by:
mcix earned 200 total points
ID: 1431117
It really depends on what you are trying to accomplish.

There are two schools of thought.

1. Open a connection to the database when the app starts and persist it for the life of the app. This works well for databases like Access, FoxPro, etc..., where you are not all that worried about the number of connections to the db.

2. Open a connection to the database when you need it and close it after you have the data/recordset you desire.  This method is more desirable for ODBC DB's where you have connection limits.

3. A new concept is to populate a disconnected recordset.  This is very similar to option 2, but also you to have control binding and reattach/connect to the database and perform a batch update.  This is being used in Internet/Intranet application.
0
 
LVL 4

Expert Comment

by:mcix
ID: 1431118
To answer your original question about opening a table on two forms...

There is absolutely nothing that prohibits you from opening the same table in two forms.  An issue you would have with this approach would most likely be a record-locking between the two forms.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

680 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question