Solved

close databases

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

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…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

776 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