Home All Groups Group Topic Archive Search About

change the database password (Access)

Author
14 Aug 2006 11:26 PM
JohnK
ok, ya got me, how do I change the database password via code?

Author
15 Aug 2006 12:56 PM
Paul Clement
On Mon, 14 Aug 2006 16:26:02 -0700, JohnK <Jo***@discussions.microsoft.com> wrote:

¤ ok, ya got me, how do I change the database password via code?

You can use ExecuteNonQuery with the following:

"ALTER DATABASE PASSWORD " & "new_password" & " " & "old_password"

You will need to add the following to your connection string in order to open the database for
exclusive use (required when changing the database password):

Mode=Share Deny Read|Share Deny Write


Paul
~~~~
Microsoft MVP (Visual Basic)
Author
15 Aug 2006 1:45 PM
JohnK
thanks,
the part I was having trouble with was the exclusive lock
Mode=Share Deny Read|Share Deny Write
Seems to work now

Show quote
"Paul Clement" wrote:

> On Mon, 14 Aug 2006 16:26:02 -0700, JohnK <Jo***@discussions.microsoft.com> wrote:
>
> ¤ ok, ya got me, how do I change the database password via code?
>
> You can use ExecuteNonQuery with the following:
>
> "ALTER DATABASE PASSWORD " & "new_password" & " " & "old_password"
>
> You will need to add the following to your connection string in order to open the database for
> exclusive use (required when changing the database password):
>
> Mode=Share Deny Read|Share Deny Write
>
>
> Paul
> ~~~~
> Microsoft MVP (Visual Basic)
>

AddThis Social Bookmark Button