Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

How to close a specific resource handle?

How to close a specific resource handle?

How to close a specific resource handle?

I've got a VB.NET app that is leaking file handles despite me disposing of the OdbcConnection and OdbcCommand objects correctly.  Eventually these file handles proliferate to the point of causing errors due to low system resources.  I need to find out how to use the API to locate all file handles in use by my process, and shut down any that match a certain description (which is the path to the folder where the database is located).  This has to be done automatically from within my program and not using any external utility.  Any suggestions are appreciated.

RE: How to close a specific resource handle?

Why do you known there are leaks?
In VB, data controls can keep data files open where you should think you closed them. If you wrote code to open a database and later you wrote code to close it, this doesn't mean all your databases are closed. Controls can hold some databases open. You also need to close them with extra code.

RE: How to close a specific resource handle?

I don't use data controls.  I do it all in code.  Thanks for the suggestion though.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close