Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
open database method
Hello,
I use to methods in Excel VBA to open/and extract data from Access. A problem I am noticing is when the macro is complete, if I go into my task manager under processes it shows that Access continues to run, although Access does not appear to be open at all. How do I prevent this from happening. Bellow I have shown the two methods I use. This seems to happen no matter if I use the, dba.Close and dba.DoCmd.CloseDatabase, methods or not. Thank You, Dim dba As Access.Application Dim stgPath As String Set dba = CreateObject("access.application") stgPath = ("file.mdb") dba.OpenCurrentDatabase filepath:=stgPath and Set dba = OpenDatabase("file") Set rst = dba.OpenRecordset("Table", dbOpenDynaset, dbReadOnly) [a8].CopyFromRecordset rst 'dba.Close |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
open database method
Have you tied
Set dba = nothing That might work. "tjh" wrote: Hello, I use to methods in Excel VBA to open/and extract data from Access. A problem I am noticing is when the macro is complete, if I go into my task manager under processes it shows that Access continues to run, although Access does not appear to be open at all. How do I prevent this from happening. Bellow I have shown the two methods I use. This seems to happen no matter if I use the, dba.Close and dba.DoCmd.CloseDatabase, methods or not. Thank You, Dim dba As Access.Application Dim stgPath As String Set dba = CreateObject("access.application") stgPath = ("file.mdb") dba.OpenCurrentDatabase filepath:=stgPath and Set dba = OpenDatabase("file") Set rst = dba.OpenRecordset("Table", dbOpenDynaset, dbReadOnly) [a8].CopyFromRecordset rst 'dba.Close |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
open database method
Do you mean after the statements below are complete is when I should set dba
= nothing? "Jim Thomlinson" wrote: Have you tied Set dba = nothing That might work. "tjh" wrote: Hello, I use to methods in Excel VBA to open/and extract data from Access. A problem I am noticing is when the macro is complete, if I go into my task manager under processes it shows that Access continues to run, although Access does not appear to be open at all. How do I prevent this from happening. Bellow I have shown the two methods I use. This seems to happen no matter if I use the, dba.Close and dba.DoCmd.CloseDatabase, methods or not. Thank You, Dim dba As Access.Application Dim stgPath As String Set dba = CreateObject("access.application") stgPath = ("file.mdb") dba.OpenCurrentDatabase filepath:=stgPath and Set dba = OpenDatabase("file") Set rst = dba.OpenRecordset("Table", dbOpenDynaset, dbReadOnly) [a8].CopyFromRecordset rst 'dba.Close |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Update database from ODBC query (or another method) | Excel Worksheet Functions | |||
Open current database method | Excel Programming | |||
Open method used | Excel Programming | |||
Excel 2003 Workbooks.Open with CorruptLoad=xlRepairFile fails on Excel 5.0/95 file due to Chart, with Error 1004 Method 'Open' of object 'Workbooks' failed | Excel Programming | |||
Workbook Open method | Excel Programming |