Session Object Methods
The following shows details of the session object methods.
Description
This property retrieves database types for the current session.
Example
strDatabaseType = SessionCmd.DBType
Description
This property retrieves the database’s name for the current session.
Example
strDatabaseName = SessionCmd.DBName
Description
This property retrieves the tool release database version for the current session.
Example
strToolReleaseDatabase = SessionCmd.ToolsRelDB
Description
This property retrieves the server’s name for the current session. It retrieves nothing if the user is logged on in two-tier.
Example
strServerName = SessionCmd.ServerName
Description
This property retrieves the user’s ID for the current session.
Example
strOperatorId = SessionCmd.OprId
Description
This property identifies whether the current session is two-tier. If the return value is TRUE (or a value of 1), the current session is two-tier.
Example
bTwoTier = SessionCmd.TwoTier
Description
This property retrieves or sets a ShowWarnings option for the current session.
Example
Retrieve Example:
Dim bShowWarnings As Boolean
bShowWarnings = SessionCmd.ShowWarnings
Set Example:
Dim bShowWarnings as Boolean
bShowWarnings = True
SessionCmd.ShowWarnings = bShowWarnings
Description
The AmountSql property retrieves or sets an Amount SQL option for the current session.
Example
Retrieve Example:
Dim bAmountSql As Boolean
bAmountSql = SessionCmd.AmountSql
Set Example:
Dim bAmountSql as Boolean
bAmountSql = True
SessionCmd.AmountSql = bAmountSql
Syntax
ReadConfig([in] BSTR ConfigDir)
Description
This method retrieves the directory paths of a given PS/nVision Configuration Manager setting (as defined in the Windows Registry). If the user has multiple directory paths in the same configuration setting, it retrieves them all. The available configuration settings that can be retrieved are:
InstanceDir
LayoutDir
TemplateDir
MacroDir
StyleDir
DrillDownDir
Example
Dim strDirPath as String
strDirPath = SessionCmd.ReadConfig("LayoutDir")
Syntax
ReadConfigDir([in] BSTR ConfigDir, [in] WORD nPosition)
Description
This method retrieves one directory path of a given PS/nVision Configuration Manager setting (as defined in the Windows Registry). This method differs from the ReadConfig method: it parses out the list of available directories by providing a number representing the position of the directory in the list.
For example, if you had two directories, such as c:\user\nVision\layout
and c:\user
, and you wanted just the c:\user
directory, you would pass in the number
two. If the user is looking for the second directory and there is
only one, then nothing is retrieved. The list of available configuration
settings that can be retrieved is as follows:
InstanceDir
LayoutDir
TemplateDir
MacroDir
StyleDir
DrillDownDir
Example
Dim strDirPath as String
strDirPath = SessionCmd.ReadConfig("LayoutDir", 2)
This retrieves the second directory listed.