title: Unable to open ADODB recordset (with password)
body: <p>I have the below code to open a connection to another Access database and then open a recordset</p>
  
  <pre><code>Sub OpenTest()
  Dim Acon As New ADODB.Connection
  Dim rst As ADODB.Recordset
  
   With Acon
      .Provider = "Microsoft.ACE.OLEDB.12.0"
      .ConnectionString = "C:\MyFolder\MyDb.accdb"
      .Properties("Jet OLEDB:Database Password") = "OpenSesame"
      .Open
   End With
  
   Set rst = New ADODB.Recordset
   rst.Open "SELECT * FROM tblAdmin", Acon, adOpenDynamic, adLockReadOnly
  
   If rst.EOF = False Or rst.BOF = False Then
      rst.MoveFirst
      Debug.Print rst!UserID
   End If
  
   Set rst = Nothing
   Acon.Close
  End Sub
  </code></pre>
  
  <p>The connections itself opens fine but then strangely the recordset fails to open and I get a run time error saying </p>
  
  <blockquote>
    <p>Not a valid password</p>
  </blockquote>
  
  <p>The password is definitely correct (as evidenced by the connection opening). When setting the password on the database I ensured that the legacy encryption option was selected for compatability. I have also used this code to open a different database and it works fine. </p>
  
  <p>Does anybody have any idea why it may not be working?</p>