You have various ways to add security to your application. You can implement one or more of these techniques, depending on the type of security that is required for your application. For example, you can assign passwords to the database and/or to the code, and you can encrypt the database. Let's look at each of these concepts in more detail.
One way to add security to your database is to require a user to input a password before the database can be opened. This is called file-level security. After the database file has been opened by specifying the correct password, the user can do anything to the database unless the other security features are implemented.
You have at least two ways to set a database password. One way is to select the Database Tools ribbon Encrypt with Password option. You will be prompted to enter a password for the database. Another way to set a database password is programmatically using VBA code. For example, you can execute SQL statements against the database to set, change, and remove a database password. Here are sample SQL statements for each of these options:
'SQL statement for setting password for first time (from NULL to some value) strSQL = "ALTER DATABASE PASSWORD [newpassword] NULL" 'SQL statement for changing the database password strSQL = "ALTER DATABASE PASSWORD [anotherpassword] ...