Home
Forums
New posts
Search forums
Articles
Latest reviews
Search resources
Members
Current visitors
Newsgroups
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Home
Forums
Newsgroups
Microsoft Access
Microsoft Access VBA Modules
Relink To Backend DB that Protected
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Guest, post: 9674844"] Hallo I would like to relink my Front end DB with a Backend DB that password protected This is the code i am using at the moment but its missing the part for the password. On Error GoTo Startup_Err Dim tdf As DAO.TableDef Dim strD As String Dim strC As String Dim strMM As String Dim strFilename As String Dim strIMEX As String Dim db As DAO.Database Set db = CurrentDb strD = "\\cmms acr log\tables\" DoCmd.OpenForm "frmLinkingTables" For Each tdf In CurrentDb.TableDefs If Len(Nz(tdf.Connect, "")) > 0 Then ' non-local If Right(tdf.Connect, 3) = "dat" Then If InStr(tdf.Connect, strD) = 0 Then ' need to reconnect Forms!frmLinkingTables!lblTable.Caption = tdf.Name strIMEX = Left(tdf.Connect, InStr(tdf.Connect, "Database=") + 8) strC = strIMEX & strD & "tables.dat" tdf.Connect = strC tdf.RefreshLink DoEvents End If Else strFilename = getfile(Mid(tdf.Connect, 11)) If InStr(tdf.Connect, strD) = 0 Then ' need to reconnect Forms!frmLinkingTables!lblTable.Caption = tdf.Name tdf.Connect = (";DATABASE=" & strD & strFilename) tdf.RefreshLink End If End If End If Next DoCmd.Close acForm, "frmLinkingTables" Startup_Exit: Exit Sub Startup_Err: If Err.Number = 2450 Then 'form is missing MsgBox "Cancelling Linking" Resume Startup_Exit Else MsgBox Err.Description Resume Startup_Exit End If End Sub [/QUOTE]
Verification
Post reply
Home
Forums
Newsgroups
Microsoft Access
Microsoft Access VBA Modules
Relink To Backend DB that Protected
Top