Search code examples
c#ms-accessoledbpassword-protectionwindows

Change Access Database password using jet OLEDB in c#


Can anyone please tell me how I can change the password that I am using to protect my .accdb file, from my windows form application that uses the access file as database source, using OLEDB Connection. I want this to work because I want to grant the user the provition of password changing from default to anything of their choice. Oledb is preffered but any kind of solution is welcome :) but please donot suggest to open the file in MSAccess & change password. :p Thanks in advance.


Solution

  • Use ALTER DATABASE PASSWORD @newPassword @oldPassword through an OleDbCommand.