> For the complete documentation index, see [llms.txt](https://dbi-services.gitbook.io/omrun-help/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dbi-services.gitbook.io/omrun-help/configuration/customize-own-adapter/customize-data-adapter.md).

# Own data adapter

### ![](/files/zHpn0Kr3JoqcJh6Texsw)

You can add your own adapter or copy an existing adapter and fit it to your needs by changing the connect string.

<figure><img src="/files/lhTuDRoToigNL6MlyNTO" alt="OMrun button configuration" width="80%"><figcaption><p>OMrun button configuration</p></figcaption></figure>

1. On OMrun Ribbon choose `Config`
2. Select tab `Data Adapter`

<figure><img src="/files/qIGka32ymVDrteIkcgKz" alt="OMrun configuration - data adapter" width="80%"><figcaption><p>OMrun configuration - data adapter</p></figcaption></figure>

***

| Column         | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| DB Type        | Describes what kind of data can be read with this adapter.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Trusted        | <ul><li>Select checkbox to connect to the data with the credentials of the current user logged-in.</li><li>Deselect checkbox to connect to the data with user id and password field provided by Connect String.</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Provider Group | Displays all the included Data Provider. These information are predefined and can't be changed. If you need an additional data adapter, please get in contact.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| Connect String | <p>The connect string contains the information that the provider need to know to establish a connection to the database or the data file.</p><p>Assembly:<br>• A connect string consists of a series of keyword - value pairs separated by semicolons (;)</p><ul><li>The equal sign (=) connects each keyword and its value<br>Example: Key1=Value1;Key2=Value2;Key3=Value3;</li><li>The information in the connection string is passed on to the provider</li></ul><p>The connect string may contains placeholders like myServer, myDataBase and myUserName, myPassword and myPort.<br>These placeholders will be resolved in <a href="https://gitlab.com/dbiservices/omrun/help/-/blob/v5.x/element-overview/environment.md">Environment</a>.</p><p><a href="https://www.connectionstrings.com/">Click here</a> for more information about connect strings (external link).</p> |
| Remark         | Enter your comments or parameter description here.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |

### Special Settings

<figure><img src="/files/jXVuXBtPZs4e9xUBdjQi" alt="OMrun environment adapter settings"><figcaption><p>OMrun environment adapter settings</p></figcaption></figure>

The adapters "Avaloq (Oracle)" and "Avaloq (TNS Oracle)" contain the variable @SessionUnlock which has to be filled in field "Data Source" on screen [Environment](https://gitlab.com/dbiservices/omrun/help/-/blob/v5.x/configuration/customize-own-adapter/element-overview/environment.md%22) as example shown below with the specific command to open the session security for Avaloq systems.

***

### Text Files

Options for text files with OLEDB Adapter: Extended Properties="text;HDR=yes;IMEX=1;FMT=Delimited";

Notice that only the directory for the text file is specified in the connection string. The filename of the text file is specified in the T-SQL commands that access data in the text file, similar to a table name in a database.

***

<table data-full-width="true"><thead><tr><th>Keyword</th><th>Remark</th></tr></thead><tbody><tr><td>HDR=No</td><td>First row does not contain field description.</td></tr><tr><td>HDR=Yes</td><td>First row contains field description.</td></tr><tr><td>FMT=Delimited</td><td><p>Delimited fields with default delimiter.<br>See Windows start button → settings → control panel → regional settings, Number tab → list separator</p><p>You can access files that use nonstandard text delimiters and fixed-width text files by creating a schema.ini file in the same directory as the text file. A text file, vehicle_semi.txt.</p><p><img src="/files/ggQJ388KUZPJQJt1eRMZ" alt="" data-size="original"></p><p>A possible schema.ini file for the vehicle_semi.txt file is:</p><p>[vehicle_semi.txt]<br>Format=Delimited(;)<br>ColNameHeader=True<br>MaxScanRows=0<br>Character=OEM<br>Col1=VehicleId Long Width 4<br>Col2=Mark Text Width 255<br>Col3=Model Text Width 255<br>Col4=Color Text Width 255<br>Col5=EmptyWeight Long Width 255</p></td></tr><tr><td></td><td><p>The connect string contains the information that the provider need to know to establish a connection to the database or the data file.</p><p>Assembly:<br>A connect string consists of a series of keywords - value pairs separated by semicolons (;)</p><ul><li>The equal sign (=) connects each keyword and its value<br>Example: Key1=Value1;Key2=Value2;Key3=Value3;</li><li>The information in the connection string is passed on to the provider</li></ul><p>The connect string may contains placeholders like myServer, myDataBase and myUserName, myPassword and myPort. These placeholders will be resolved in Environment.</p><p>Click <a href="https://www.connectionstrings.com/">https://www.connectionstrings.com/</a> for more information about connect strings (external link).</p></td></tr><tr><td></td><td><p>Enter your comments or parameter description here.</p><p>You can specify the fields in the text file in two ways:</p><ul><li>Include the field names in the first row of the text file and set the <strong>ColNameHeader</strong> option to True.</li><li>Identify each column using the format ColN (where N is the one-based column number) and specify the name, width, and data type for each column.</li></ul><p>The <strong>MaxScanRows</strong> option indicates how many rows should be scanned to automatically determine column type. A value of 0 indicates that all rows should be scanned.</p><p>The <strong>ColN</strong> entries specify the name, width, and data type for each column. This entry is required for fixed-length formats and optional for character-delimited formats. The syntax of the ColN entry is:</p><p><strong>ColN</strong>=columnName dataType [Width n]</p><p>The parameters in the entry are:</p><p>columnName</p><ul><li>The name of the column. If the column name contains spaces, it must be enclosed in double quotation marks.</li></ul><p>dataType</p><ul><li>The data type of the column. This value can be Bit, Byte, Currency, DateTime, Double, Long, Memo, Short, Single, or Text.</li><li>DateTime values must be in one of the following formats: dd-mmm-yy, mm-dd-yy, mmm-dd-yy, yyyy-mm-dd, or yyyy-mmm-dd, where mm is the month number and mmm are the characters specifying the month.</li></ul><p>Width n</p><ul><li>The literal value Width followed by the integer value specifying the column width.</li></ul><p>The <strong>Character</strong> option specifies the character set; you can set it to either ANSI or OEM.</p></td></tr><tr><td></td><td></td></tr><tr><td>Format=CSVDelimited</td><td>Fields are delimited with commas. This is the default value.</td></tr><tr><td>Format=Delimited(customCharacter)</td><td>Fields are delimited with a custom character. You can use any single character except the double quotation mark (") as a delimiter.</td></tr><tr><td>Format=FixedLength</td><td>Fields are fixed length. If the ColumnNameHeader option is True, the first line containing the column names must be comma-delimited.</td></tr><tr><td>Format=TabDelimited</td><td>Fields are delimited with tabs.</td></tr><tr><td></td><td></td></tr><tr><td>Format=CSVDelimited</td><td>Fields are delimited with commas. This is the default value.</td></tr><tr><td>Format=Delimited(customCharacter)</td><td>Fields are delimited with a custom character. You can use any single character except the double quotation mark (") as a delimiter.</td></tr><tr><td>Format=FixedLength</td><td>Fields are fixed length. If the ColumnNameHeader option is True, the first line containing the column names must be comma-delimited.</td></tr><tr><td>Format=TabDelimited</td><td>Fields are delimited with tabs.</td></tr></tbody></table>

### Excel Files

If column contains a mixed alphabetic and numeric values, use the IMEX setting.:

Extended Properties="Excel 12.0;HDR=Yes;IMEX=1";
