Database connection format
- Last UpdatedFeb 24, 2023
- 3 minute read
- PI System
- PI SQL Client OLEDB 2021
- Developer
To connect to a database, PI SQL Client OLEDB uses a connection string. The connection string for PI SQL Client OLEDB needs to include:
-
The name of the PI AF server machine and the database name, for example,
-
Optional PI SQL Client OLEDB connection string keywords, for example,
Connection examples
The syntax to use the PI SQL Client OLEDB tables and connect to the PI AF server is:
Provider=PiSqlClient; Data Source=AFServer\AFDatabase;
For example:
PS PIHOME\SQL\SQL Client\OLEDB\Tools> .\iPiSql.ps1 -connectionString
"Provider=PiSqlClient; Data Source=myAFServer\myAFDatabase; Integrated Security=SSPI;"
Standard OLEDB connection string keywords
|
Connection string keyword |
Description |
Examples |
|---|---|---|
|
|
Name of a PI AF server and AF database, separated by a backslash, to connect to. |
|
|
|
Provider specific properties that can contain all other keywords. |
|
|
|
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 Generate views, TVFs and function tables for PI SQL Client in the PI SQL Commander Lite User Guide. |
|
|
|
Name of the authentication service. Setting the property to "SSPI" (Security Service Provider Interface) invokes a trusted connection. |
|
|
|
Password to use for authentication when you log on to the PI SQL DAS. |
|
|
|
The prompt mode designates whether the provider should ask for the missing information. Note: This property is not persisted in the connection string. |
|
|
|
User ID to use for authentication when you log on to the PI SQL DAS. |
|
|
|
Window handle from the calling application. It is used as a parent window of the dialog prompting for the missing information. Note: This property is not persisted in the connection string. |
PI SQL Client-specific connection string keywords
|
Connection string keyword |
Description |
Examples |
|---|---|---|
|
|
Command timeout in seconds. |
|
|
|
The culture (locale) for the connection. The locale determines:
|
(default)
|
|
|
Order of the protocols used. |
(default) |
|
|
Default is , but also supports , and PI time literals. |
|
|
|
Supports Windows time zone format, IANA time zone format, and . |
|
|
|
Specifies the maximum string size to be returned, because some clients may not handle long strings correctly. Use for unlimited size. Defaults to . |
|