Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

check table def for password

Status
Not open for further replies.

mikeyp3

IS-IT--Management
Jan 7, 2003
11
US
Is there a better way to do this...I have a bunch of db's that have linked tables, we will be password protecting these linked db's with possibility of any 1 of 4 different passwords. My thought is coded below>>>if password 1 errors 'incorrect password' try password 2....etc

Do
tbl.Properties("Jet OLEDB:Link Provider String") _
= "MS Access;Pwd=" & pass
Debug.Print pass
Debug.Print Err.Description
Select Case pass
Case "rt"
pass = "funds"
Case "funds"
pass = "Reports"
Case "reports"
pass = "mike"
End Select

Loop Until Err.Number <> -2147467259

This code still errors out even though the last password is correct. I've stepped through it and the password gets assigned....but returns the same error??
 
oops!....forgot to set err.number back to zero
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top