CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 1999
    Location
    Wisconsin
    Posts
    12

    ClosingAccessApplicationFrom VB

    I am creating as Access Application from VB and then am running a macro stored in Access. When I am done running the macro I want to close the Access application that I created and return to the VB code. This is working except the databse I open closes but Access remains open. The only way I can close Access is going into Task Manager and end process. I cant even close Access by hitting the close button. Is there a way to close this? The following is the code that I am currently using. I thought when I set the oAccess = nothing this would close Acccess out of memory??

    Dim oAccess As Access.Application

    Start = Timer
    Do While Timer < Start + 30
    DoEvents
    Loop

    Set oAccess = CreateObject("Access.Application")
    oAccess.OpenCurrentDatabase ("E:\Database.mdb")
    DoEvents
    oAccess.DoCmd.RunMacro "Run Macro"
    DoEvents
    oAccess.CloseCurrentDatabase
    DoEvents
    Set oAccess = Nothing


  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: ClosingAccessApplicationFrom VB

    try oAccess.Quit before setting oAccess to Nothing


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured