Groups, Users, and Security
Security is a database property that requires a user to provide a user name and password to access the database. By default, database security is turned off.
Database security can be turned on through PCC or by executing an SQL statement. Once enabled, you may create groups and users and assign permissions to them. Permissions can include database rights, table rights, and column rights within tables.
When you turn security on or off, the Master user must have only one connection open and must be the only user connected.
As soon as you turn security on for the first time, only the Master user can access the database. The Master user password, as with all PSQL passwords, is case sensitive.
*Caution: If you turn on security, be sure to specify a password with a significant length. Do not leave the password field blank because doing so creates a major security risk for your database.
See PSQL Security chapter in Advanced Operations Guide for additional information about security.
Security Tasks
This section contains step-by-step tasks pertaining to security. The tasks are divided into the following categories:
See Data Encryption in Advanced Operations Guide.
General Tasks
1
Name reflects the name of the user currently logged in to the database. If the database does not have security enabled, name is Master. Name may also be Master if the current user is logged in as Master.
Any nodes expanded for the database are collapsed.
2
3
Click Login.
4
*Note: If you are the Master user, logging in as another user can help in testing the more restrictive permissions that you have assigned this user.
If the database resides on a remote machine, you must provide a user name and password of an administrator or of a member of the Pervasive_Admin group for the remote machine. The user name and password is not required if the database resides on the local machine to which you are logged in (and the local machine is not running Terminal Services).
Turning on security prevents all users from accessing the database unless they log in to it using a valid database user name and password. User names and passwords cannot be set up until security is turned on, so the database will be inaccessible to each user for the period of time until you have set up a user account for that user.
1
In PSQL Explorer, expand the Engines node, then the Databases node.
2
3
Click Security in the Properties tree.
4
Click the Security tab.
5
Click Enable Security to check mark the option.
6
Type the password you want for Master Password, then re-type it for Confirm Password.
7
Database security is now on and you are logged in as the Master user. For instructions on creating database user accounts, see User and Group Tasks.
You must be logged into the computer as an administrator or as a member of the Pervasive_Admin operating system security group.
Turning on security prevents all users from accessing the database unless they log in to it using a valid database user name and password. User names and passwords cannot be set up until security is turned on, so the database will be inaccessible to each user for the period of time until you have set up a user account for that user.
1
2
In the File menu of PCC, click New > SQL Document (or click in the toolbar).
The Select Database dialog box appears.
3
4
5
In SQL Editor, issue the SQL statement SET SECURITY= ‘password’ where password is the text string you want to use as the password for the Master user.
6
Click SQL > Execute in Text (or click in the toolbar).
See also SET SECURITY in SQL Engine Reference.
You must be logged into the computer as an administrator or as a member of the Pervasive_Admin operating system security group.
*Caution: Turning off security allows all operating system users to access the database if database security is Mixed or Database mode.

Database user names, passwords, and permissions are retained but not used if security is turn off. If security is reenabled, the previous user names, passwords, and permissions take effect again. (An exception is the Master user. The Master password is not retained or reapplied.)
1
In PSQL Explorer, expand the Engines node, then the Databases node.
2
3
Click Security in the Properties tree.
4
Click the Security tab.
5
Click Enable Security to clear the option.
6
Database security is now off.
*Caution: Turning off security allows all operating system users to access the database if database security is Mixed or Database mode.

Database user names, passwords, and permissions are retained but not used if security is turn off. If security is reenabled, the previous user names, passwords, and permissions take effect again. (An exception is the Master user. The Master password is not retained or reapplied.)
1
2
In the PCC File menu, click New > SQL Document (or click in the toolbar).
The Select Database dialog appears.
3
4
5
6
Click SQL > Execute in Text (or click in the toolbar).
See also SET SECURITY in SQL Engine Reference.
Btrieve Security Policy Tasks
*Caution: Changing security policy for a database may prevent current users from accessing the database, if security is turned on and the given users do not have equivalent user accounts and rights under the new security policy.
1
2
In PSQL Explorer, expand the Engines node, then the Databases node.
3
4
Click Security in the Properties tree.
5
Click the Btrieve Security tab.
6
Click the desired policy: Classic, Mixed, or Database.
7
See also the chapter PSQL Security in Advanced Operations Guide.
*Caution: If your database has security turned on and you change from Classic security policy to Mixed or Database, all users are prevented from accessing the database until you create database user accounts and privileges for them.
1
In PSQL Explorer, expand the Engines node, then the Databases node.
2
3
Click Directories then click New.
4
If your files are spread over many directories, specify a high-level directory that they all have in common. You can specify a root level if necessary, but doing so includes in the database all PSQL+ files at the root level and its subordinate directories.
You do not need to enter every directory, just the lowest level directory that is common to all Btrieve files you want to include in the database.
5
6
User and Group Tasks
Note that you cannot add a group to another group.
1
2
3
Right-click the Groups node then click New > Group.
4
5
Click Finish.
1
2
3
Right-click the Users node then click New > User.
4
5
Type a password for Password and re-type it for Confirm Password.
Passwords are case sensitive. For a list of database object lengths and invalid characters, see Identifier Restrictions by Identifier Type in Advanced Operations Guide..
6
Click for Group, then click the desired group in the list.
7
Click Finish.
Note that a given user cannot be a member of more than one group. All users in a group have exactly the permissions defined for that group. You cannot grant or revoke individual permissions for a user who is a member of a group.
1
2
3
Right-click a user name under the Users node then click Properties.
4
Click General in the Properties tree.
5
Click for Group, then click the desired group in the list.
6
Note that a group can be deleted only if no users are assigned to it.
1
2
Expand the Groups node or Users node.
3
4
Click Delete.
5
Click Yes.
1
2
In the File menu of PCC, click New > SQL Document (or click in the toolbar).
The Select Database dialog box appears.
3
4
5
Refer to the following statements in SQL Engine Reference:
6
To execute the statement, click SQL > Execute in Text (or click in the toolbar).
Assigning Permissions Tasks
*Note: Permissions on the Database tab override permissions on the Table tab.
1
2
Right-click the group name under the Groups node then click Properties.
3
Click Permissions in the Properties tree.
4
5
A check mark indicates that the permission applies.
6
*Note: You cannot assign specific permissions to a user if the user is a member of a group. The permissions of the group apply to the user.

Permissions on the
Database tab override permissions on the Table tab.
1
2
Right-click the user name under the Users node then click Properties.
3
Click Permissions in the Properties tree.
4
5
A check mark indicates that the permission applies.
6
*Note: Permissions on the Database tab override permissions on the Table tab.
1
2
Right-click the group PUBLIC under the Groups node then click Properties.
3
Click Permissions in the Properties tree.
4
5
A check mark indicates that the permission applies.
6
1
In the PCC File menu, click New > SQL Document (or click in the toolbar).
The Select Database dialog box appears.
2
3
4
In SQL Engine Reference, see the following:
5
Click SQL > Execute in Text (or click in the toolbar).