Solved

close databases

Posted on 1998-08-26
2
121 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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now