Results 1 to 3 of 3

Thread: Wait for access

  1. #1
    Guest
    I am making a vb6 front end (menu) to several access97 programs (.mdb with startup form). The problem is i need the vb code to suspend execution until the user closes access.
    The Set appObj = GetObject(, "Access.Application") to check if it's running doesn't seem to work cause i think the reference it's returning won't let the user shut access down.
    The Detect MS Office tip will let me see if access is running or not, but doesn't seem to let the user close it either.
    Any help would be Greatly appreciated!
    -Marti

  2. #2
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    are you by anychace letting your app go into a loop checking if the apps running with the Detect MS Office Tip of which you speak(I havn't seen it) does your code look something like this

    Code:
    Private Function DetectAccess() as Boolean
    
    'returns True If access is running
    
    End Function
    
    Private Sub WaitForAccessToFinish
    
    Do While DetectAccess
    Loop
    
    End Sub
    if so add a doevents line to your loop so it looks like this


    Code:
    Private Function DetectAccess() as Boolean
    
    'returns True If access is running
    
    End Function
    
    Private Sub WaitForAccessToFinish
    
    Do While DetectAccess
    
        DoEvents
    
    Loop
    
    End Sub
    Hope this helps.

  3. #3
    Guest
    The 'Set appObj = nothing' is in hopes of releasing the reference to access (in DetectAccess 'Set appObj = GetObject(, "Access.Application")'). If GetObject returns err = 0 the reference to the object was retrieved - access is alive.
    That was my test if the user had closed it yet.

    The 'Count(5)' just goes and counts 5 seconds before returning. Which also has a doevents in the middle of that loop 'cause I'm thinking it's during one of the doevents that access will be closed?


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