GetDatabaseSetName
Description
Returns the name of the database set of which this database is a member.
You can use this method to get the database set name of this database. You can pass this name to the Session object's GetAccessibleDatabases method to get a list of the user databases in the database set.
Note: By default, systems have only one database
set. You can refer to this default database set using an empty string
("") instead of the name returned by this method.
Syntax
VBScript
dbDesc.GetDatabaseSetName
Perl
$dbDesc->GetDatabaseSetName();
- Identifier
- Description
- dbDesc
- A DatabaseDesc object containing information about one of the installed databases.
- Return value
- A String containing the name of the database set.
Examples
VBScript
The following example shows you how to log on to the database from a Visual Basic application.
set sessionObj = CreateObject("CLEARQUEST.SESSION")
' Login to each database successively.
databases = sessionObj.GetAccessibleDatabases("MASTR","","")
For Each db in databases
If Not db.GetIsMaster Then
dbSetName = db.GetDatabaseSetName
dbName = db.GetDatabaseName
' Logon to the database
sessionObj.UserLogon "tom", "gh36ak3", dbName,
AD_PRIVATE_SESSION, dbSetName
End If
' ...
Next
Perl
use CQPerlExt;
#Start a Rational
ClearQuest session
$sessionObj = CQSession::Build();
#Get a list of accessible database description objects
$databases = $sessionObj->GetAccessibleDatabases("MASTR", "", "");
#Get the number of databases
$count = $databases->Count();
#Foreach accessible database that is not the master database, login as
#user "tom" with password "gh36ak3"
for($x=0;$x<$count;$x++){
$db = $databases->Item($x);
if (! $db->GetIsMaster() ) {
#Get the database set of which this database is a member
$dbSetName = $db->GetDatabaseSetName();
#Get the database name from the description object
$dbName = $db->GetDatabaseName();
# Logon to the database
$sessionObj->UserLogon( "tom", "gh36ak3", $dbName, $dbSetName );
}
#...
}
CQSession::Unbuild($sessionObj);