Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

close databases

Posted on 1998-08-26
2
Medium Priority
?
131 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 400 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses

824 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