Database Connections not getting closed

Posted on 2003-02-21
Medium Priority
Last Modified: 2010-05-01
I am using DataGrid controls based on a Data Environment command object which provides a record set.
When i open the form everything loads fine and a database connection is made.
I close the form, but i am still in the application, but the connection to the database is not getting closed.
In this way if i have 20 users and 30 forms (most of the forms i am using the data grid control based on Data Environment) and i am using atleast 1000 connections which are not getting closed unless the user exits from the application.
Most of the time i get Database conections maxed out.
How can we close the connections of the Datagrids underlying recordset which was based on a command in a Dataenvironment?
Is there any way to close the connection?
Question by:balmoori
  • 2
LVL 18

Accepted Solution

Sethi earned 600 total points
ID: 7997364
When you use a data Environment Connection object, it is a Public connection object that caters to all connection requirement of your application. When you load a form the connection object is used to run the command object, and when you unload the form the command object is terminated but the connection object remains there. It is this very connection object that is used when you open another form. So even if you have 30 forms there are not 30 connection objects but onely 1. As far as 20 users are concerned, 20 connection objects are created at the client end and not at the server. So there also you dont have to worry.

Expert Comment

ID: 8901312
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Experts: Post your closing recommendations!  Who deserves points here?
LVL 18

Expert Comment

ID: 8910960
Recommendation: Points to Sethi
LVL 49

Expert Comment

ID: 8964069
Moderator, my recommended disposition is:

    Accept Sethi's comment(s) as an answer.

DanRollins -- EE database cleanup volunteer

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
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…
Suggested Courses
Course of the Month12 days, 19 hours left to enroll

578 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