+ Reply to Thread
Results 1 to 2 of 2

VBA code to open access db in exclusive mode

Hybrid View

  1. #1
    Registered User
    Join Date
    09-13-2008
    Location
    Montreal
    MS-Off Ver
    Office XP
    Posts
    80

    VBA code to open access db in exclusive mode

    Hello all,

    Here is a snippet of my code can someone help me in adjusting it to have the access database open exclusively please

    Dim db As Database
    Dim ws As Workspace
    Dim rs As Recordset
    Dim r As Long
    Set ws = DBEngine.Workspaces(0)
    Dim Wks As Worksheet
        
        Set Wks = Worksheets("CE")
      'On Error GoTo ErrHandler:
    
            
            Set db = ws.OpenDatabase _
       (Sheet2.Range("A30"), _
           False, False, "MS Access;PWD=q1w2e3r4")

  2. #2
    Registered User
    Join Date
    09-13-2008
    Location
    Montreal
    MS-Off Ver
    Office XP
    Posts
    80

    Re: VBA code to open access db in exclusive mode

    Found the answer.

    Dim db As Database
    Dim ws As Workspace
    Dim rs As Recordset
    Dim r As Long
    Set ws = DBEngine.Workspaces(0)
    Dim Wks As Worksheet
        
        Set Wks = Worksheets("CE")
      'On Error GoTo ErrHandler:
    
            
            Set db = ws.OpenDatabase _
       (Sheet2.Range("A30"), _
           True, False, "MS Access;PWD=q1w2e3r4")

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1