Developer Documentation Library > Interviewer - Server > Administration and maintenance > Databases > Project (case data) databases > Naming a default database
 
Naming a default database
You can name a default case data database that can be written to by more than one project. This is a useful approach if you have an automated back-up script and do not want to have to update it with the names of each new project database. When UNICOM Intelligence Interviewer writes case data for more than one project to a single database, it includes the project name with the data so that users can extract data for the individual projects, and so that a project’s data can be deleted when the project is deleted. Interview.Config.xml defines a default database called Respondents, but you must create this database if you want to use it as the installation procedure does not create it.
You can define different default databases for different roles or users. This is good if you want all the members of a role to use the same database; for instance, if you have separate roles for different clients’ work.
Project databases are defined in the <Access Control> section of Interview.Config.xml as shown in the following example. To tag one as the default database, add the attribute default="true" to its definition.
<AccessControl>
  <Default>
    <Presets>
      <ProjectDatabases>
        <ProjectDatabase name="Respondents" default="true"/>
      </ProjectDatabases>
    </Presets>
  </Default>
</AccessControl>
The database specified in the ProjectDatabases property is added to Launch activity’s database list. The specified database does not automatically become the default Launch activity database.
The procedure for defining role-specific databases is the same, except that the <Presets> section appears in the roles section of the file. In the following example, users in the ScriptGroup1 role can write to the Group1Data or MiscData databases, with the default being the Group1Data database. Members of ScriptGroup2 can write to the Group2Data or MiscData databases, with the default being the Group2Data database. In both cases, users see a list with two names and the appropriate default name is selected.
<AccessControl>
  <Roles>
    <ScriptGroup1>
      <Presets>
        <ProjectDatabases>
          <ProjectDatabase name="Group1Data" default="true"/>
          <ProjectDatabase name="MiscData"/>
        </ProjectDatabases>
      </Presets>
    </ScriptGroup1>
    <ScriptGroup2>
      <Presets>
        <ProjectDatabases>
          <ProjectDatabase name="Group2Data" default="true"/>
          <ProjectDatabase name="MiscData"/>
        </ProjectDatabases>
      </Presets>
    </ScriptGroup2>
  </Roles>
</AccessControl>
See also
Project (case data) databases