Relink to BE with a Database Password

M

Markus

Hallo

I hope some one can help me i want to be able to relink my BE tables from
the FE but the back end has a database password is this possible and how.

Regards
Markus
 
M

Markus

Hallo

I tryd it .Connect = ";Database=" & strDBPath ;PWD=mypassord and i get the
error Compole Error Expecte: end of Statement highlighting the ";"
 
M

Markus

it does not work if i change the backend password to a new password and enter
like the new string you gave me it does not work it does not give and error
and when i want enter the table it has the error invalid password. Do you
know if it is possible to update the systemtable where the password to the
back end is stored

Markus
 
M

Markus

No it still does not work it does not relink them once i change the password
even after closing the FE and opening it again

Markus
 
M

Markus

Alex

It does work but only if the location of the BE has moved if the BE is still
in the same location then it does not refreh the link because its still at
the same location but the password has changed do you know how i can get
aroung that. I need it to refresh even if the BE table has not been moved

This is the code



Public Sub Startup()
On Error GoTo Startup_Err
Dim tdf As DAO.TableDef
Dim strD As String
Dim strC As String
Dim strFilename As String
Dim strIMEX As String
Dim db As DAO.Database
Set db = CurrentDb
Dim Pass As String

Pass = "markus0425"

MsgBox Pass
strD = getpath(db.Name) & "Tables\"
DoCmd.OpenForm "frmLinkingTables"


For Each tdf In CurrentDb.TableDefs
If Len(Nz(tdf.Connect, "")) > 0 Then ' non-local
If Right(tdf.Connect, 3) = "xls" 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 & tdf.Name & ".xls"
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 &
";PWD=" & Pass
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
 
M

Markus

Hi Alex

I found out how to do the refresh now and it works fine but i have one more
problem is there a way i can ignore 1 table so thatthe table does not get
refreshed

Thanks a lot for you help so far

Markus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top