HypSetConnectionInfo

Data source types: Essbase, Planning (ad hoc only), Financial Management (ad hoc only), Hyperion Enterprise (ad hoc only)

Description

HypSetConnectionInfo() is used to modify the connection information in the query.

The parameters passed for HypSetConnectionInfo() should be match the connection information stored with that connection name.

Note:

This function is used specifically with dynamic link views, as described in VBA Functions and Dynamic Link Views.

Syntax

HypSetConnectionInfo (vtServerName, vtUserName, vtPassword, vtApplicationName, vtDatabaseName, vtFriendlyName, vtURL, vtProviderType)

ByVal vtServerName As Variant

ByVal vtUserName As Variant

ByVal vtPassword As Variant

ByVal vtApplicationName As Variant

ByVal vtDatabaseName As Variant

ByVal vtFriendlyName As Variant

ByVal vtURL As Variant

ByVal vtProviderType As Variant

Parameters

vtServerName: The server name in the query.

vtUserName: The user name in the query.

vtPassword: The user password in the query.

vtApplicationName: The application name in the query.

vtDatabaseName: The database name in the query.

vtFriendlyName: The friendly connection name in the query.

vtURL: The provider URL in the query.

vtProviderType: The provider type in the query.

Return Value

Returns 0 if successful; otherwise, returns the appropriate error code.

Example

Declare Function HypSetConnectionInfo Lib "HsAddin" (ByVal vtServerName As Variant, ByVal vtUserName As Variant, ByVal vtPassword As Variant, ByVal vtApplicationName As Variant, ByVal vtDatabaseName As Variant, ByVal vtFriendlyName As Variant, ByVal vtURL As Variant, ByVal vtProviderType As Variant) As Long

Sub Macro()
   Dim vtGrid as Variant
   Sts = HypConnect(Empty, "system", "password", "DemoBasic")
   Sts = HypRetrieve(Empty)
   Range (“B2”).Select
   Sts = HypGetSourceGrid (Empty, vtGrid)
   Sts = HypSetConnectionInfo(“localhost”, “system”, 
    “password”,        “Sample”, “Basic”, “SampleBasic”, 
    “http://localhost:13080/aps/SmartView”, provider)
End sub