DeleteDataSourceInfo Method

Deletes security access information for a PowerCube data source from memory.

Syntax

Application.DeleteDataSourceInfo(ConnectionType, Location)

Applies To

Application Object

Discussion

Use this method to remove the access information records, such as cube password, stored in memory by the SetDataSourceInfo method.

To delete all data source access information records from memory, use the DeleteAllDataSourceInfo method.

This method can be used to prevent unauthorized users from opening subsequent reports based on the same data source after all desired reports are open. A good situation to use this method is AfterDocOpen macro for the last report to be opened.

Parameter

Description

Connection Type

Required. Identifies whether the connection type is for a local cube or a remote package. This parameter can be either "local" or "remote".

Type: String

Location

Required.

If the connection type is local, then a fully qualified local cube is expected. For example, "C:\Cubes\Great Outdoors.mdc"

If the connection type is remote, then a package search path in native encoding or a store ID is expected.

Search path example, "/content/package[@name=Great Outdoors]"

Store ID example, "storeID('iAA1ECBF2EA9B46F78651D4787F219509')"

Type: String

Return Type

Boolean

Example

This example sets the cube security access information record and then opens a report based on the password protected cube. Next, the data source security access record is deleted from memory.

Sub Main()
     Dim objPPApp As Object
     Dim objPPRep As Object
     Dim strMDCName As String
     Set objPPRep = CreateObject("CognosPowerPlay.Report")
     Set objPPApp = objPPRep.Application
     strMDCName = "C:\Cubes and Reports\Sample1.mdc"
     objPPApp.SetDataSourceInfo "local", strMDCName,
"cube_password"
     objPPRep.Open "C:\Cubes and Reports\Sample1.ppx"
     objPPApp.DeleteDataSourceInfo("local", strMDCName)
     Set objPPRep = Nothing
     Set objPPApp
End Sub

Related Topics