Link to home
Start Free TrialLog in
Avatar of mxclouti
mxclouti

asked on

Changing Access password with ADO

I'm using ADO 2.0 to connect to an Access 97 database (with security) through an ODBC System DSN. It's working fine.

I would like to know how to change a user's password with ADO.

Is it possible, if so, how do I do that ?
Avatar of vmano
vmano

ADO Data Control has Password Property which Sets the password used during creation of an ADO Recordset object.

Syntax - object.Password [= string]

object - An object expression that evaluates to an object... for example an ADO data control
string - Sets the password for the user named in the UserName property.

This property setting is write-only — it may only be provided in code, it cannot be read back from the Password property.

let me know if this helps
vmano
Avatar of mxclouti

ASKER

I'm not using the ADO Data Control and I don't want to.

I'm using Microsoft ActiveX Data Objects 2.0 Library (MSADO15.DLL)

I'm connecting to my Access Database (with security) this way:

Dim conADO As ADODB.Connection
Set conADO = New ADODB.Connection
conADO.Open "DSN=WMS_REL;UID=mxclouti;PWD=mxclouti;"

where WMS_REL is an ODBC SYSTEM DSN pointing to my Access Database WMS_REL.MDB. I' m also using the system database WMS_REL.MDW for the security.

Once the user is connected to the database, I want him to be able to change his password:

Old password: xxxxx
New password: xxxxx
Verification: xxxxx
(OK) (CANCEL)

I'm waiting for your answer.

Thanks
Now I know that:

Users and passwords are included in the table msysAccounts of WMS_REL.MDW. Fieldnames are FGroupe, Name, Password and SID.

So, it's very easy to connect to WMS_REL.MDW with ADO and change the password.

But I need to provide and encrypted password.

The question is, how do I encrypt the new password before updating the field Password where Name = "mxclouti".

Thanks in advance.
check out the EE article
https://www.experts-exchange.com/topics/comp/lang/visualbasic/Q.10086508

about "making a password" answered by Waty.
Article https://www.experts-exchange.com/topics/comp/lang/visualbasic/Q.10086508 shows how to encrypt a password. Ok

But, is it the same encryption algorithm that is used to encrypt the password field in msysAccounts in my .MDW file.

Thanks.

I am not sure.
Is it possible to change a password in the table msysAccounts of a .MDW file ? The field Password is an encrypted field.
ASKER CERTIFIED SOLUTION
Avatar of altena
altena

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I'll be using USER.NEWPASSWORD then.

Thanks.