Rocky Smolin
rockysmolin at bchacc.com
Thu Apr 29 18:00:24 CDT 2010
Dear List:
I'm making some progress on this user's requirement to password protect his
back end. He says it's OK to hard code his password in the front end (it's
an mde).
But I ran into a problem relinking the back end. I'm using Tribble's
relinker (with some minor mods) - and I need it because this app supports
multiple back ends - there's a database Open utility which allows the user
to open a copy of the back end or any other back end cloned from the
original delivered back end (no modifications to the tables, please).
I get to this piece of code where the link is refreshed:
For Each tdf In db.TableDefs
Call frmProgressMeter.pmIncrement( _
strIncrementMessage:="Checking table: " & tdf.Name)
If Len(tdf.Connect) > 0 Then
intI = intI + 1
If InStr(1, gstrRegisteredName, "ABC") <> 0 Then
tdf.Connect = ";DATABASE=" & varFileName & ";pwd='abcdefgh'"
Else
.Connect = ";DATABASE=" & varFileName
End If
MsgBox tdf.Connect
' The RefreshLink might fail if the new path
' isn't OK. So trap errors inline.
On Error Resume Next
tdf.RefreshLink
If Err <> 0 And InStr(1, tdf.Name, "MWCI") = 0 Then
MsgBox strError, vbExclamation, "Table Link Failure - " & tdf.Name &
Err
Application.Quit
End If
End If
varFileName contains the patha and name of then back end.
The app starts out linked to a back end that has no password. I use the
app's Open a Database Utility to point to the back end with the password and
call Tribble's Relinker.
If the registered user name contains ABC (true in this case) then I set the
Connect property of the Table Def (tdf) using the password. Otherwise, not.
When it comes down to tdf.RefreshLink, I get an 'Invalid Password' error.
Does anyone know why this should happen?
MTIA
Rocky Smolin
Beach Access Software
858-259-4334
www.e-z-mrp.com <http://www.e-z-mrp.com/>
www.bchacc.com <http://www.bchacc.com/>