Database.NewPassword method (DAO)

Applies to: Access 2013, Office 2013

Changes the password of an existing Microsoft Access database engine database (Microsoft Access workspaces only).

Syntax

expression .NewPassword(bstrOld, bstrNew)

expression An expression that returns a Database object.

Parameters

Name

Required/optional

Data type

Description

bstrOld

Required

String

The current setting of the Password property of the Database object.

bstrNew

Required

String

The new setting of the Password property of the Database object.

NOTE: Use strong passwords that combine upper- and lowercase letters, numbers, and symbols. Weak passwords don't mix these elements. Strong password: Y6dh!et5. Weak password: House27. Use a strong password that you can remember so that you don't have to write it down.

Remarks

The bstrOld and bstrNew strings can be up to 20 characters long and can include any characters except the ASCII character 0 (null). To clear the password, use a zero-length string ("") for bstrNew.

Passwords are case-sensitive.

If a database has no password, the Microsoft Access database engine will automatically create one by passing a zero-length string ("") for the old password.

Important

If you lose your password, you can never open the database again.