Solved

close databases

Posted on 1998-08-26
2
125 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Updates not working for MS Windows 7 12 181
MS Access - Capture pressed key onclick 4 41
VB6 - Compare and highlight cell not the same 3 53
transition to visual .net from vb6 5 40
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

829 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