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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting new database password with ADO

Status
Not open for further replies.

DeltaTech

Programmer
Apr 16, 2003
92
MY
Hello everyone
I am using ADO and Access database. For security reasons, I would like to reset the database password through code periodically.
IN DAO it was as simple as db.Newpassword(oldPassword, newPassword), but for the life of me, I cannot seem to find a similar method in ADO.
Anyone out there who knows how I can do this?
Much appreciated.
[bigcheeks]
 
Thanks BiggerBrother.
For those of you who may be interested, here is a sample code:


Code:
Private cn As ADODB.Connection
Private strSQL as string

Set cn = New ADODB.Connection
cn.Mode = adModeShareExclusive
cn.Open "Provider=Microsoft.jet.OLEDB.4.0;Data Source='C:\whatever.mdb'"
strSQL = "ALTER Database Password " & "newpassword" & "``"
cn.Execute strSQL

Note that the database must be opened in exclusive mode.

[bigcheeks]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top