Access Automation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • relicx2004
    New Member
    • May 2014
    • 9

    Access Automation

    I want to open another MDB database with BOTH database password and workgroup user level security enabled without prompting user to login and input a database password. My solution at this moment is to open it with the shell command to bypass the login prompt then use SendKeys functions to provide the database password. Is there a better approach instead of using SendKeys in setting up the database password. Any suggestions are welcome. Thank you. AGL

    Code:
    Function OpenAccess(bolSet As Boolean)
    
    Dim x As Variant
    
          x = Shell(GetAccessExe & " " & Chr(34) & GetPath & Chr(34) & " /nostartup /user " & GetWorkspaceUser(bolSet) & _
          " /pwd " & GetWorkspacePassword(bolSet) & " /wrkgrp " & Chr(34) & GetSecurity & Chr(34), vbMaximizedFocus)
            
        GetSecurityPassword 'SendKeys Function
    
    End Function
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32661

    #2
    I'm not aware there is a better method if you're using that approach.

    You could try looking at what's possible using the /Profile option or you could consider opening the database using Application Automation instead.

    I'm not positive either approach will yield the result you want, but I suspect they're both worth looking into further.

    Comment

    • relicx2004
      New Member
      • May 2014
      • 9

      #3
      Thanks for the quick response. The link that you have provided was similar to my first method but my problem with that was since shell already opens the access database, .OpenCurrentDat abase wont work since it will open again the same database.

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32661

        #4
        I was simply suggesting you explore the ideas further. I'm not in a position to give you definitive answers I'm afraid, but I would suggest that if you used "Application Automation instead" then it would be instead of using Shell(). I don't see a scenario where both would be used in tandem.

        Comment

        Working...