STEM help / Editor skills

4.13.6 Understanding an explicit ODBC link

STEM is supplied with a number of built-in ODBC driver identifiers. These are shown in the ODBC Driver list in the Define External Link dialog, and also in the ODBC Drivers dialog, which you can access directly from the Options menu. In the Microsoft SQL Server example above, the identifier SQL is selected for the link.

In order to understand how STEM interprets this identifier, and to examine the other identifiers:

  1. Select ODBC Drivers from the Options menu. The ODBC Drivers dialog is displayed.
  2. Select SQL from the ODBC Driver list.
  3. Click the View… button. The View ODBC Driver dialog is displayed.

Viewing an ODBC driver

The SQL identifier is associated with a connection string:

DRIVER={SQL Server};SERVER=%p;DATABASE=%p;UID=sa;PWD=;

which STEM uses to connect to the ODBC source (in this case, the database server).

However, the %p elements are first replaced with the parameters supplied for the link, so that the actual connection string for the example above is:

DRIVER={SQL Server};SERVER=MyServer;DATABASE=MyDatabase;

UID=sa;PWD=;

Note: The user-id sa is the default system-administrator id for many databases.

This driver identifier mechanism means you do not have to enter the whole connection string in the formula bar, and hopefully defers indefinitely the need for you to enter an ODBC connection string yourself! You can repeat the process above for the other built-in identifiers to see how they work, and what parameters they require.

Note: When you create a new external link, the default driver identifier is <none>, which simply instructs STEM to act according to the file extension.

Link parameters

Each %p in the connection string identifies a parameter to be supplied by a link. If you need to supply a filename as a parameter, then a %f will identify a filename parameter which tells STEM that the Browse button and Relative path check-box can be used to manipulate the corresponding parameter in the Define External Link dialog. You are not permitted to use more than one %f parameter in a connection string.

Note: You have to use %% if you need to embed a literal ‘%’ in a connection string.

 

© Implied Logic Limited