GetDatabase method

Retrieves the audit store database object given the database display name.

Syntax

AuditStoreDatabase class GetDatabase(
	string displayname
)

Parameters

Specify the following parameter when using this method.

Parameter Description

displayname

The display name of the audit store database that you want to get.

Return value

Returns the AuditStoreDatabase object of the specified database.

Errors

The GetDatabase method may throw one of the following exceptions:

  • Centrify.DirectAudit.Common.Logic.AuthenticationException if you do not have permission to connect to the Microsoft SQL Server instance that hosts the management database or you do not have permission to connect to the Microsoft SQL Server instance of the audit store database to be created.
  • Centrify.DirectAudit.Common.Logic.ConnectDatabaseException if you cannot connect to the Microsoft SQL Server instance either because the instance is not running or does not allow remote connections.

Discussion

Use this method to obtain the audit store database object of any database attached to the audit store if you already have the audit store database display name.

Example

The following code sample illustrates using AuditStore.GetDatabase in a script:

...

today = Date
strDatabaseName = strDatabaseName & "-" & Year(today) & "-" & Month(today) & _
& "-" & Day(today)
 
SET objAuditStoreDatabase = objAuditStore.GetDatabase(strDatabaseName)
 
IF NOT objAuditStoreDatabase IS NOTHING THEN
    wscript.echo "Audit Store database '" & strDatabaseName & "' already exists."
    wscript.quit
END IF