HypConnect
Describes the Oracle Smart View for Office VBA function, HypConnect.
On-premises data provider types: Oracle Essbase, Oracle Hyperion Planning, Oracle Hyperion Financial Management
Note:
Cloud data sources: HypConnect is not supported for cloud data sources. To connect to a cloud data source (for example, a Planning source), you must use the HypUIConnect function. See HypUIConnect.
Description
HypConnect() logs into a data provider and associates the worksheet with that connection. HypConnect() must be called for each sheet in order to associate this connection with that sheet.
HypConnect() can be used in two ways:
-
Using a friendly connection name.
The friendly connection name is first created using HypCreateConnection.
-
Using a connection string, in the place of a friendly name, consisting of URL, server, application, database name.
Syntax
HypConnect (vtSheetName, vtUserName, vtPassword, vtFriendlyName)
ByVal vtSheetName As Variant
ByVal vtUserName As Variant
ByVal vtPassword As Variant
ByVal vtFriendlyName As Variant
Parameters
vtSheetName: The name of worksheet on which to run the function. If vtSheetName is Null
or Empty
, the active worksheet is used.
vtUserName: A valid user name
vtPassword: The password for this user
vtFriendlyName: The connection name of the data provider. The friendly name parameter can accept either of the following:
-
A connection name created using HypCreateConnection
-
A connection string consisting of a URL, server name, application name, and database name, in the format
URL|server|app|db
.The
URL
component of the connection string follows the guidelines in Private Connection URL Syntax in the Oracle Smart View for Office User's Guide .
Return Value
Returns 0 if successful; otherwise, returns the appropriate error code.
Example Using a Friendly Name
In this example, we connect to the Essbase Sample application, Basic database, with the friendly name of "My Sample Basic."
Declare Function HypConnect Lib "HsAddin" (ByVal vtSheetName As Variant, ByVal vtUserName As Variant, ByVal vtPassword As Variant, ByVal vtFriendlyName As Variant) As Long
Sub Example_HypConnect()
X=HypConnect("Empty", "UserName", "Password", "My Sample Basic")
End Sub
Essbase Example Using a Connection String
In this example, we connect to the Essbase Sample application, Basic database.
HypConnect("Sheet1", "UserName", "Password", "http://hostname:19000/aps/SmartView|servername|Sample|Basic")
Oracle Hyperion Planning Example Using a Connection String
In this example, we connect to the Oracle Hyperion Planning Vision application, Plan1 database.
HypConnect("Sheet1", "UserName", "Password", "http://hostname:9000/HyperionPlanning/SmartView|servername|Vision|Plan1")
Financial Management Example Using a Connection String
In this example, we connect to the Financial Management STATJP4 application.
HypConnect("Sheet1", "UserName", "Password", "http://hostname:19000/hfmadf/officeprovider|<servername>|STATJP4|STATJP4")
Note that for Financial Management, the db
component can be empty; for example:
HypConnect("Sheet1", "UserName", "Password", "http://hostname.com:19000/hfmadf/officeprovider|<servername>|STATJP4|")