@DbName (Formula Language)

Returns the name of the current Domino® server and database.

Syntax

@DbName

Return value

server ; path

Text list with two elements:

  • server is the hierarchical name of the server on which the current database resides.

    This @function returns an empty string ("") if:

    • the database is local
    • the formula is used in a Scheduled agent running on the server
    • the formula is used in a view column

    Use @Name to extract a part of the name; for example, [CN] to extract the common name.

  • path is the path and file name of the database.

    This @function returns:

    • the path relative to the Notes® or Domino data directory if the database is in the data directory
    • the absolute path if the database is outside the data directory

    If the database is accessed through a directory or database link, this @function returns the location of the:

    • link if the @function is running locally (even if the database is on a server), so that the database appears to be where the link is
    • actual database if the @function is running on a server (for example, a scheduled agent)

Usage

Be careful when using @DbName in a column formula. If you build a view, then move the database within the file directory, thus changing its path, you must force a rebuild of the view (Cntl+Shift+F9) for the function to display the updated database information.

Examples

  1. This example returns ";PERSONAL.NSF" if the current document is in the PERSONAL database stored in the data directory of the user's own computer.
    @DbName
  2. This example returns "SALES1;ADMIN\STATUS.NSF" if the current document is stored in a Domino database named STATUS.NSF in the ADMIN directory on the SALES1 server. If the database is stored at the server's root directory (that is, it is not stored in a subdirectory), the result would be "SALES1;STATUS.NSF." You can extract just the file name of the list by combining @DbName with @Subset, as shown in the example.
    @DbName
  3. This example returns "STATUS.NSF", the file name, since this is the last element in the returned list.
    @Subset(@DbName;-1)
  4. This example returns the path of the current database, without the file name. For example, if the current database is SENSES\SOUNDS\SIGH.NSF, this formula returns "SENSES\SOUNDS."
    @LeftBack(@Subset(@DbName;-1);"\\")
  5. This example displays the server, path, and file name of the current database, substituting the common name for the hierarchical name of the server.
    database := @Subset(@DbName; -1);
    server := @Name([CN]; @Subset(@DbName; 1));
    @Prompt([OK]; "Database name"; @Implode(server) + " " + @Implode(database))

Language cross-reference

FileName property of LotusScript® NotesDatabase class

FilePath property of LotusScript NotesDatabase class

Server property of LotusScript NotesDatabase class

FileName property of Java Database class

FilePath property of Java Database class

Server property of Java Database class