Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB Databases
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Pro VB Databases Advanced-level VB coding questions specific to using VB with databases. Beginning-level questions or issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 28th, 2004, 03:22 AM
Registered User
Join Date: Aug 2004
Location: , , Iran.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to close database opened by adodc

Dear all,

I used adodc to navigate through a database but when I close the program , the lock file which is created at the time of opening database won't be deleted and it would remain as the connection to database isn't closed. I tested different codes to close the database but it wasn't successful such as adodc1.recordset.close.

Thank you,

Reply With Quote
  #2 (permalink)  
Old September 28th, 2004, 08:04 AM
Authorized User
Join Date: Sep 2004
Location: Delhi, Delhi, India.
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Lalit_Pratihari


Try this out.

1. Add a reference to Microsoft ActiveX Data Objects 2.0 (or higher) Library.

2. declare a object of the connection object and the recordset.

3. Add the code before closing the application

lets say
Conn is the object for Connection
Rs is the object for Recordset

If Conn.State = adStateOpen Then
End if

If Rs.State = adStateOpen Then
End if

Hope this helps,

Life Means More...;)
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
When should you close the database connection? Stickannn Pro PHP 0 September 13th, 2007 04:25 AM
How to Close a Form when already Opened in C# akumarp2p C# 1 December 4th, 2006 09:45 PM
Database update on window close hemal_301080 ASP.NET 1.0 and 1.1 Professional 1 August 12th, 2006 02:34 PM
Close Database using VBA Stanny Access VBA 4 May 31st, 2006 01:49 AM

All times are GMT -4. The time now is 10:00 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.