You've already forked OpenIntegrations
mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2025-11-27 22:18:36 +02:00
71 lines
2.2 KiB
Plaintext
Vendored
71 lines
2.2 KiB
Plaintext
Vendored
---
|
|
sidebar_position: 5
|
|
description: Generate connection string 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]
|
|
---
|
|
|
|
import Tabs from '@theme/Tabs';
|
|
import TabItem from '@theme/TabItem';
|
|
|
|
# Generate connection string
|
|
Forms a connection string from the passed data
|
|
|
|
|
|
|
|
`Function GenerateConnectionString(Val Address, Val Base = "", Val Login = "", Val Password = "", Val Port = "", Val WindowsAuth = False) Export`
|
|
|
|
| Parameter | CLI option | Type | Required | Description |
|
|
|-|-|-|-|-|
|
|
| Address | --addr | String | ✔ | Database server address and instance |
|
|
| Base | --db | String | ✖ | Name of the database to connect |
|
|
| Login | --login | String | ✖ | mssql user login |
|
|
| Password | --pass | String | ✖ | mssql user password |
|
|
| Port | --port | Number | ✖ | Server port |
|
|
| WindowsAuth | --trust | Boolean | ✖ | Use Windows authentication. The login and password will be ignored |
|
|
|
|
|
|
Returns: String - MSSQL connection string
|
|
|
|
<br/>
|
|
|
|
:::tip
|
|
This function allows you to quickly assemble a basic connection string. In case you need more flexible configuration, you can also form (obtain) this connection string on your own (ADO format)
|
|
:::
|
|
<br/>
|
|
|
|
|
|
```bsl title="1C:Enterprise/OneScript code example"
|
|
Address = "127.0.0.1";
|
|
Login = "bayselonarrend";
|
|
Password = "12we...";
|
|
|
|
Result = OPI_MSSQL.GenerateConnectionString(Address, , Login, Password);
|
|
```
|
|
|
|
|
|
<Tabs>
|
|
|
|
<TabItem value="bash" label="Bash" default>
|
|
```bash
|
|
oint mssql GenerateConnectionString \
|
|
--addr "127.0.0.1" \
|
|
--login "SA" \
|
|
--pass "***"
|
|
```
|
|
</TabItem>
|
|
|
|
<TabItem value="bat" label="CMD/Bat" default>
|
|
```batch
|
|
oint mssql GenerateConnectionString ^
|
|
--addr "127.0.0.1" ^
|
|
--login "SA" ^
|
|
--pass "***"
|
|
```
|
|
</TabItem>
|
|
</Tabs>
|
|
|
|
|
|
```json title="Result"
|
|
"Server=127.0.0.1;User Id=bayselonarrend;Password=***;"
|
|
```
|