2025-07-10 08:54:42 +03:00
---
sidebar_position: 1
2025-07-10 09:02:33 +03:00
description: Create Connection and other functions to work with MSSQL in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, MSSQL]
2025-07-10 08:54:42 +03:00
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Create Connection
Creates a connection to the specified base
`Function CreateConnection(Val ConnectionString = "", Val Tls = "") Export`
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| ConnectionString | - | String | ✖ | Connection string. See GenerateConnectionString |
| Tls | - | Structure Of KeyAndValue | ✖ | TLS settings, if necessary. See GetTlsSettings |
Returns: Arbitrary - Connector object or structure with error information
<br/>
:::caution
**NOCLI:** this method is not available in CLI version
:::
<br/>
```bsl title="1C:Enterprise/OneScript code example"
2025-10-21 11:36:43 +03:00
Address = "127.0.0.1";
2025-07-10 08:54:42 +03:00
Login = "SA";
2025-10-21 11:36:43 +03:00
Password = "12we...";
2025-07-10 08:54:42 +03:00
ConnectionString = OPI_MSSQL.GenerateConnectionString(Address, , Login, Password);
2025-09-01 14:51:24 +03:00
TLSSettings = OPI_MSSQL.GetTLSSettings(True);
2025-07-10 08:54:42 +03:00
Result = OPI_MSSQL.CreateConnection(ConnectionString, TLSSettings);
```
2025-07-14 15:21:39 +03:00
```json title="Result"
2025-09-12 20:23:31 +03:00
"AddIn.OPI_MSSQL.Main"
2025-07-14 15:21:39 +03:00
```