Connection string format
- Last UpdatedSep 27, 2023
- 2 minute read
- PI System
- PI SQL Client ODBC 2021
- Developer
ODBC can use a connection string to connect to a database without using a DSN. The connection string for PI SQL Client ODBC includes:
-
The driver name, for example,
-
The AF Server machine name or Location, for example, or
-
The AF Database name or Data Source, for example, or
-
Optionally, PI SQL Client ODBC connection string keywords, for example,
The following examples show the syntax for the connection string:
Driver=PI SQL Client; AF Server=myAfServer; AF Database=myAfDatabase; Integrated Security=SSPI;
Driver=PI SQL Client; Location=myAfServer; Data Source=myAfDatabase; Integrated Security=SSPI;
Connection string keywords
The following table lists available keywords for the PI SQL Client ODBC connection string.
|
Connection string keyword |
Description |
Examples |
|---|---|---|
|
Initial Catalog |
The initial catalog. Note: By default, the data model for PI SQL Client consists of one catalog - Master. This catalog contains a set of tables and table-valued functions. For information about how to create other catalogs, see the PI SQL Commander Lite User Guide. |
(default) |
|
Integrated Security |
Name of the authentication service. Setting the property to SSPI (Security Service Provider Interface) invokes a trusted connection. |
(default) |
|
Protocol Order |
Order of the protocols used. |
(default) |
|
Query Date |
Defaults to Latest. Also supports now and PI time literals. See the PI Server topic, PI time. |
|
|
Time Zone |
Defaults to Local. You can set a specific time zone used for parsing of timestamp literals and for rendering of timestamp column values. |
|
|
User ID, User, or UID |
The User ID to use of authentication when you log on to the data source. |
|
|
Password or Pwd |
The password to use for authentication when you log on to the data source. |
|
|
FileDSN |
Specify an ODBC File data source to use for the connection. |
|
|
Variant as String |
True or False (default). Original Variant columns will be exposed as String columns. |
|
|
GUID as String |
True or False (default). Original GUID columns as String columns. |
|
|
Maximum string size |
Specifies the maximum string size to be returned, because some clients may not handle long string correctly. Use 0 for unlimited size. Defaults to 4000. |
|
|
Command Timeout |
Enter the command timeout in seconds. Enforces the command timeout for all commands, even if ODBC statement query timeout was specified. |
|