Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel connection to ODBC database | Excel Discussion (Misc queries) | |||
link ODBC connection to an Oracle database | Excel Discussion (Misc queries) | |||
Database Connection Nested VLookup option | Excel Discussion (Misc queries) | |||
Serial Letter- Connection with Excel database | Excel Discussion (Misc queries) | |||
Does destroying the ADO Connection close the database? | Excel Programming |