?
Solved

Database Connections not getting closed

Posted on 2003-02-21
4
Medium Priority
?
124 Views
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?
0
Comment
Question by:balmoori
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 18

Accepted Solution

by:
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.
0
 

Expert Comment

by:CleanupPing
ID: 8901312
balmoori:
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?
0
 
LVL 18

Expert Comment

by:Sethi
ID: 8910960
Recommendation: Points to Sethi
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 8964069
Moderator, my recommended disposition is:

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

DanRollins -- EE database cleanup volunteer
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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…
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 Month9 days, 7 hours left to enroll

762 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