# Connect To Database

This action can be used to Connect to a database, either it being local or external

## Properties<br>

![](https://649489153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MSSr3DfBuOYIkk2T9ec%2Fuploads%2F3IZjrMODHhpKazmwJPso%2Fimage.png?alt=media\&token=a0c3a408-6377-48de-9104-8e3214c89817)

### ‌Connection

![](https://649489153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MSSr3DfBuOYIkk2T9ec%2Fuploads%2FzpBh9R0xmT3bIN7hLWmF%2Fimage.png?alt=media\&token=a53b4c6f-a152-4586-a3aa-8b4b57698b47)

* **SQL Driver:** to which will be used to connect to the SQL Server;
* **SQL Server Address:** The SQL Server host address, to which the connection will be made;
* **Port:** The port of the SQL host (default port for Microsoft SQL Server 2019 is 1433);
* **SQL Server Name:** The SQL Server name;
* **Connection String:** The Connection String that will be used to connect to the SQL Server.

{% hint style="info" %}
**Note:** The **Connection String** overrides all other settings in the Connection panel.

If you want to use the previous settings, the **Connection String must be empty.**
{% endhint %}

### **Database** <a href="#misc" id="misc"></a>

![](https://649489153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MSSr3DfBuOYIkk2T9ec%2Fuploads%2FSYywE9SN0onnB75ztG1t%2Fimage.png?alt=media\&token=dcba5c6b-e202-4e61-84df-7f4985bdcf7f)

* **Database:**  The name of the database which will be used to perform all the queries.

### **Authentification**

![](https://649489153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MSSr3DfBuOYIkk2T9ec%2Fuploads%2FfivaAytmzCX9Bhw8qwyf%2Fimage.png?alt=media\&token=fe043d39-ac5a-4802-b76e-43a2b23321ef)

* **Method:** The authentification method which will be used to connect to the SQL Server (Server Authentification or Windows Authentification);
* **Username:** The username which will be used to connect to the SQL Server;
* **Password:** The password which will be used to connect to the SQL Server;

### Output

![](https://649489153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MSSr3DfBuOYIkk2T9ec%2Fuploads%2F6NSaaAoXiZzOxjhf1Pvs%2Fimage.png?alt=media\&token=5f1abbbb-6710-4d35-89b0-bd4a0e6475be)

* **Database Connection:** The DatabaseConnection object which will be used to interract with the SQL Server

{% hint style="info" %}
**Note:** This object **must** have the **Variable Type** set to **DatabaseConnetion.**
{% endhint %}

### Misc

![](https://649489153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MSSr3DfBuOYIkk2T9ec%2Fuploads%2Fa67MScfdTzGKFHVwmwtS%2Fimage.png?alt=media\&token=e0cd24f8-57f1-42c9-8ce2-f07cb0d1e6ea)

* **Display Name**: action display name in your implementation project.
* **Wait Before**: number milliseconds robot to wait before executing the action.
* **Wait After:** number milliseconds robot to wait until moving to the next action.
* **Abort on Error**: True/False.
* **Retry Times**: Specifies the number of times to retry an action if it doesn't end successfully. Default value 0 (no retry); Use -1 if you want to retry indefinitely.

## **Use Case**

### **Potential Use Cases** <a href="#potential-use-cases" id="potential-use-cases"></a>

* Connect to a database directly to bypass forms that cannot be automated through regular means.
* Connect to a database for easier handling & retrieval of data.&#x20;

{% embed url="<https://youtu.be/UarekbGwszI>" %}
