This function opens the specified database. This function
is designed specifically to allow you to enter the server name, the
database name and the path name for the database .olp file and by
doing so, this function will dynamically read the parameters and establish
a connection with PowerOLAP by opening an instance of the application
on your desktop and within the application it will open the database
that was specified in the parameter when creating the function. The
function returns no value, it simply establishes a connection.
Note:
The OLAPDatabase function can be used multiple times
in a workbook to reference different databases. While in the case
of the OLAPOpen function, it can only support one active database
reference in a workbook.
The function has the following syntax:
Syntax: OLAPDatabase
(server, database, file)
Explained below are the 3 parameters that have to
be provided when building this function.
- Server : Enter the name of the server which
has a database open on it, and is the database to which you want
to connect / enter the cell reference which has the name of this
server.
- Database : Enter the name of the database which
exists on the local drives of your computer and is the database
with which you want to establish a connection from Excel / alternatively
enter the cell reference in the Excel sheet which has the name
of such a database.
- File : Enter the name of the .OLP file that
stores the database name mentioned above, and this is the file
that's located on the local hard drives of your computer / alternatively
enter the cell reference in the Excel sheet which has the name
of such a file as its value.
Remarks
- If a connection is not established with a database
the result will be a #value.
- The database name must exist on the computer
from where you are establishing a connection.
- The path for the file name should be correctly
specified and must match exactly with the location where the file
is saved.
- The database name argument is compulsory.
- The argument or server and file name are individually
compulsory. This implies that if you have a server name specified
that has the required database open on it, then you don't need
to enter a value for the file name parameter and similarly if
you have specified a file name, then you don't need to write the
server parameter and you can fill that with empty double quotes
("").
Example
- This function may be easier to understand with
an example.
- In Excel, use the menu: Insert -> Function
and select PowerOLAP from the drop down list.
- Choose the OLAPDatabase function from the list
of functions provided and click "Ok".
- When building the formula enter the cell range
for the server name, where an already opened database resides
and the PowerOLAP database name, or alternatively, put double
quotes in the server name parameter, and enter the values for
the database name and the path for the file name, which is the
directory path where that particular file is saved.
- In the following example, "" is the
parameter for the server name that is left blank here and "Acuity"
is the name of the local PowerOLAP database. "c:\Acuity.olp"
is the path where this PowerOLAP database is stored.
=OLAPDatabase
("", "Acuity", "C:\Acuity.olp") |
The above formula signifies that the database
is "Acuity" (B1), and the path where its stored is "C:\Acuity.olp"
and the OLAPDatabase function reads this database from its name and
the path of its storage and then it opens an instance of PowerOLAP
on the users desktop and it also opens the PowerOLAP database within
the application and after this is done, a connection is established
from the Excel sheet to the PowerOLAP database. This connection now
allows the user to perform all data access and data write operations
that are facilities provided by all the PowerOLAP functions in Excel.
This function does not return a value.