Returns the name of the database.
You can use the Session object's GetAccessibleDatabases method to obtain a list of DatabaseDesc objects, and then use GetDatabaseName to get the name of each one. You use the name of the database as an argument to the Session object's UserLogon method.
VBScript
dbDesc.GetDatabaseName
Perl
$dbDesc->GetDatabaseName();
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
dbName = db.GetDatabaseName
`Logon to the database
sessionObj.UserLogon "tom", "gh36ak3", dbName, AD_PRIVATE_SESSION, ""
End If
' ...
Next
Perl
use CQPerlExt;
#Start a Rational ClearQuest session
$sessionObj = CQSession::Build();
#Get a list of accessible databases
$databases = $sessionObj->GetAccessibleDatabases("MASTR", "", "");
#Get the number of databases
$count = $databases->Count();
# Foreach accessible database, get the dbName and
# login as joe with password gh36ak3
for($x=0;$x<$count;$x++){
$db = $databases->Item($x);
$dbName = $db->GetDatabaseName();
# Logon to the database
$sessionObj->UserLogon( "joe", "gh36ak3", $dbName, "" );
#...
}
CQSession::Unbuild($sessionObj);