LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default Does destroying the ADO Connection close the database?

Yes, that's pretty much it.
Richard Choate

"Tod" wrote in message
...
Here's my newbie ADO question.

My code uses ADO to query an Access database. It's
basically like this:

cn.Open "Driver={Microsoft Access Driver (*.mdb)};Dbq=" &
ThisWorkbook.Path & "\DatabaseName.mdb;"

Sql = "SELECT * From TableName"

rs.Open Sql, cn

'Do stuff with the recordset

rs.Close
Set rs = Nothing
cn.Close
Set cn = Nothing

If I watch Windows Explorer while this code is running, I
see the file being created that says the database is in
use, then see it go away to indicate the database is
closed.

My question is this. Am I doing all I need to do by
closing the connection and destroying the object?

tod


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel connection to ODBC database Poppe Excel Discussion (Misc queries) 8 April 24th 09 06:16 AM
Relative path in database query connection string DanL Excel Discussion (Misc queries) 1 February 20th 09 06:09 PM
link ODBC connection to an Oracle database Richard Excel Discussion (Misc queries) 1 November 5th 06 04:29 PM
Database Connection Nested VLookup option needyouradvice Excel Discussion (Misc queries) 1 May 9th 06 01:09 AM
Serial Letter- Connection with Excel database Vic1978 Excel Discussion (Misc queries) 1 December 13th 05 02:07 PM


All times are GMT +1. The time now is 02:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"