DatabaseName

Description

Sets or returns the physical name of the current database. You cannot change logical name after it is set once.

Setting the name changes the information HCL Compass uses to connect to the physical database, not the actual database itself. If you change a server name, you must make sure your connection options are consistent with the new name. The database name is one of the parameters for the UserLogon method of Session object.

Setting a new value does not take effect until the ApplyPropertyChanges method is called.

Syntax

VBScript


database.DatabaseName 
database.DatabaseName newDbName 

Perl


$database->GetDatabaseName(); 
$database->SetDatabaseName(newDbName); 
Identifier
Description
database
A Database object.
newDbName
A String containing the new physical name of the database, including any associated path information (for example, "C:\temp\NewDb.mdb").
Return value
A String containing the current physical name of the database, including any associated path information.

Examples

VBScript


set sessionObj = CreateObject("CLEARQUEST.SESSION")

' Get the list of databases in the 
' MASTR database set.
databases = sessionObj.GetAccessibleDatabases("MASTR","admin","")

' Login to each database successively.
For Each db in databases 

   dbName = db.GetDatabaseName 
   sessionObj.UserLogon "admin", "", dbName, AD_PRIVATE_SESSION, "" 
' Access the database 
   ' ... 

Next 

Perl


use CQPerlExt;

#Start a session
$sessionObj = CQSession::Build();

#Get a list of accessible databases
$databases = $sessionObj->GetAccessibleDatabases("MASTR", "admin", "");
$count = $databases->Count();

# Login to each database successively. 
for($x=0;$x<$count;$x++){

   $db = $databases->Item($x);
   $dbName = $db->GetDatabaseName();

   # Logon to the database 
   $sessionObj->UserLogon( "admin", "", $dbName, "" );

   #...
 }
CQSession::Unbuild($sessionObj);