|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
change the database password (Access)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) 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) > |
|||||||||||||||||||||||