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

Tod,

Is something happening here? If you see it open and then go away this seems
to indicate all is okay, so why the question?

Closing the connection will remove the access to the database, and it is a
debatable as to whether you need to destroy the object. Even if you don't,
this is only an instance of the object in memory, it does not allow access.

--
HTH

-------

Bob Phillips
... looking out across Poole Harbour to the Purbecks


"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



Reply
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
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
Does destroying the ADO Connection close the database? Richard Choate Excel Programming 0 July 18th 03 07:45 PM


All times are GMT +1. The time now is 11:34 PM.

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

About Us

"It's about Microsoft Excel"