Retrieve Password

accessman2

Registered User.
Local time
Today, 15:49
Joined
Sep 15, 2005
Messages
335
Hi,

Suppose I create db1.mdb and db2.mdb, each one has its own workgroup (I setup user-level security).

db1.mdb with secured1.mdw
db2.mdb with secured2.mdw

I create a Account for username=John, pwd = test on both database
each database with its own workgroups have same username, and same password.

And then, I open the db1.mdb using the shortcut.

I have a function

Function add()

Dim conConnector As ADODB.Connection

Set conConnector = New ADODB.Connection

conConnector.Open "Provider='Microsoft.JET.OLEDB.4.0';Data Source=C:\db2.mdb;User Id=currentUser();Password=???;Jet OLEDB:System database=c:\secured2.mdw"

conConnector.Execute "insert into [table1] (Name,ID) Values (CurrentUser(),1)"

End Function

So, how do I retrieve the password? Because I expect there are many users using this function, I cannot fix the username and password, each user has different permission.
Please let me know, thanks.
 
Same thing, workaround

I ran into a similar situation just last week. Only both of my DBs use the same exact workgroup file. There is no way of retrieving a password that is stored in the workgroup file, just validating/setting. What I did was create an account with the priveleges needed for any of my ADO operations, and use it in my connection strings for ADO. That way I always know the correct username/password combination. I think of it as giving Access its own login to get at the information. Then you can pass whatever information you need to using this account and your individual security settings will still work with the rest of your objects (design changes ect). Just remember that whatever security privledges you give to the Access account will be used whenever working with your recordset. If you are limiting user access to information, then you will have to do so through other coding precautions, as in only getting the particular information the user has access to. Let me know if you need any more help, I've recently been tackling many Access security issues as of late.
 

Users who are viewing this thread

Back
Top Bottom