Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'd like to add to this; a password for a back end table connection can be updated in a VBA macro. Add the following lines and replace the name for the linked table &amp; the password.</p> <pre><code> Dim cdb As DAO.Database Set cdb = CurrentDb cdb.TableDefs("Projects").Connect = "MS Access;PWD=PaSsWoRd;DATABASE=C:\Users\bob.smith\Desktop\Split\Database_NEW_be.accdb" cdb.TableDefs("Projects").RefreshLink </code></pre> <p>I found this was useful after splitting a database into a front end and back end using the built in split functionality. I needed to encrypt the back end for security purposes and didn't want to have to recreate all the data connections - isn't that the point of using the split function?</p> <p>Duplicate the above lines for each linked table and let the macro run through. The linked tables should resume working after this.</p> <hr> <p>This answer solved an issue for me. So I am upvoting, and also I want to provide an enhanced version that you can run on all tables:</p> <pre><code>Public Sub RevisePasswordForLink() Dim cdb As DAO.Database Set cdb = CurrentDb Dim tdf As TableDef, colTdf As TableDefs, strConnect As String Set colTdf = cdb.TableDefs strConnect = "MS Access;PWD=paSsWoRd;" _ "DATABASE=C:\Users\bob.smith\Desktop\Split\Database_NEW_be.accdb" For Each tdf In cdb.TableDefs ''I believe best to skip the hidden tables ("MSys*") If Not tdf.Name Like "MSys*" Then ''If your DB has any local tables, you can save yourself some errors ''by filtering them out (similar to hidden tables). cdb.TableDefs(tdf.Name).Connect = strConnect cdb.TableDefs(tdf.Name).RefreshLink Debug.Print " " &amp; tdf.Name End If Next tdf Set cdb = Nothing Debug.Print "FINISHED " End Sub </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload