In this section: |
Configuring the adapter consists of specifying connection and authentication information for each of the connections you want to establish.
How to: Reference: |
In order to connect to the Excel database server, the adapter requires connection and authentication information. You supply this information using the SET CONNECTION_ATTRIBUTES command. You can:IVIV
You can declare connections to more than one Excel database server by including multiple SET CONNECTION_ATTRIBUTES commands. The actual connection to the Excel Server takes place when the first query that references the connection is issued. If you issue multiple SET CONNECTION_ATTRIBUTES commands:
You can configure the adapter from either the Web Console or the Data Management Console.
or
From the Data Management Console, expand the Adapters folder.
The Adapters folder opens.
The Add Adapter to Configuration pane opens.
The Excel adapter is under the SQL group folder.
The following list describes the connection attributes for which you can supply values. To complete the attribute declaration, click the Configure button.
Logical name used to identify this particular set of connection attributes. The default is CON01.
The data source name (DSN). There is no default data source name. You must enter a value.
This must be the name of an ODBC data source configured for the "Microsoft Excel Driver." If a File DSN is used, this must be the name of the file (for example, samplefdsn.dsn).
There are two methods by which a user can be authenticated when connecting to a data source:
Not applicable for Excel. Reserved for future use.
Not applicable for Excel. Reserved for future use.
Is the path to the ODBC File DSN that is defined on your Windows machine or network.
Select a profile from the drop-down menu to indicate the level of profile in which to store the CONNECTION_ATTRIBUTES command. The global profile, edasprof.prf, is the default.
If you wish to create a new profile, either a user profile (user.prf) or a group profile if available on your platform (using the appropriate naming convention), choose New Profile from the drop-down menu and enter a name in the Profile Name field (the extension is added automatically).
Store the connection attributes in the server profile (edasprof).
For User/System DSN:
ENGINE SQLEXCEL SET CONNECTION_ATTRIBUTES connection DSN_name/,
For File DSN:
ENGINE [SQLEXCEL] SET CONNECTION_ATTRIBUTES connection FileDSN_name/,:'filedsn=FileDSN_path;',
where:
Indicates the adapter. You can omit this value if you previously issued the SET SQLENGINE command.
Is the logical name used to identify this particular set of connection attributes.
Note that one blank space is required between connection and DSN_name.
Is the Excel Data Source Name (DSN) you wish to access. It must match an entry in the odbc.ini file.
Is the name of Excel File Data Source Name (DSN) you wish to access.
Is the path to the Excel File DSN, which may reside on the hard drive or on the network.
For User/System DSN:
The following SET CONNECTION_ATTRIBUTES command declares connection CON1 to the Excel DSN named SAMPLESERVER.
ENGINE SQLEXCEL SET CONNECTION_ATTRIBUTES CON1 SAMPLESERVER/,
For File DSN:
The following SET CONNECTION_ATTRIBUTES command declares connection CON1 using the ODBC File DSN named SAMPLESERVER.dsn.
ENGINE SQLEXCEL SET CONNECTION_ATTRIBUTES CON2 SAMPLESERVER.dsn /,:'filedsn=C:\ SAMPLESERVER.dsn;'
How to: |
Once connections have been defined, the connection named in the first SET CONNECTION_ATTRIBUTES command serves as the default connection. You can override this default using the SET DEFAULT_CONNECTION command.
ENGINE SQLEXCEL SET DEFAULT_CONNECTION connection
where:
Indicates the adapter. You can omit this value if you previously issued the SET SQLENGINE command.
Is the connection defined in a previously issued SET CONNECTION_ATTRIBUTES command. If this name was not previously declared, the following message is issued:
FOC1671, Command out of sequence
Note:
FOC1671, Command out of sequence.
The following SET DEFAULT_CONNECTION command selects the database server named SAMPLE as the default database server:
ENGINE SQLEXCEL SET DEFAULT_CONNECTION SAMPLE
How to: |
The SET AUTODISCONNECT command controls the persistence of connections when using the adapter for each of the connections you want to establish.
ENGINE SQLEXCEL SET AUTODISCONNECT ON {FIN|COMMAND|COMMIT}
where:
Indicates the adapter. You can omit this value if you previously issued the SET SQLENGINE command.
Disconnects automatically only after the session has been terminated. FIN is the default value.
Disconnects automatically after each request. Depending on how often the event occurs, the SET AUTODISCONNECT command may result in considerable overhead. Almost all of this overhead is not related to the server. It is related to the operating system and the data source.
Disconnects automatically only after COMMIT or ROLLBACK is issued as a native SQL command.
WebFOCUS |