# How to Connect DataBase using Robotframework

**URL:** https://forum.robotframework.org/t/how-to-connect-database-using-robotframework/6674
**Category:** DatabaseLibrary
**Created:** [17 January 2024 14:11 UTC](https://forum.robotframework.org/t/how-to-connect-database-using-robotframework/6674 "2024-01-17T14:11:33Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![MatheusSantosQA](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/matheussantosqa/32/3359_2.png) [@MatheusSantosQA](https://forum.robotframework.org/u/MatheusSantosQA)
#### Post date: [17 January 2024 14:11 UTC](https://forum.robotframework.org/t/how-to-connect-database-using-robotframework/6674/1 "2024-01-17T14:11:33Z")

</div>

Recently, I finished a course about Robot framework and I’m try aplly in my job.

\*\*\* Settings \*\*\*  
Library DatabaseLibrary  
Library OperatingSystem

\*\*\* Variables \*\*\*  
${DATABASE} CTC\_MSILVA  
${USERNAME} TESTE  
${PASSWORD} QA#2023  
${HOST} XXXXX  
${PORT} 1433

\*\*\* Keywords \*\*\*  
Conectar Banco de Dados SQL  
Connect To Database pymssql ${DATABASE} ${USERNAME} ${PASSWORD} ${HOST} ${PORT}

Can someone help in this error? when I tryed to connect DB

\*\*\* When I use pymssql \*\*\*  
Suite setup failed:  
OperationalError: (20009, b’DB-Lib error message 20009, severity 9:\nUnable to connect: Adaptive Server is unavailable or does not exist (host)\nNet-Lib error during Unknown error (10061)\nDB-Lib error message 20009, severity 9:\nUnable to connect: Adaptive Server is unavailable or does not exist (host)\nNet-Lib error during Unknown error (10061)\n’)

\*\*\* When I use pyodbc\*\*\*  
Suite setup failed:  
OperationalError: (‘08001’, ‘[08001] [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server inexistente ou acesso negado. (17) (SQLDriverConnect); [08001] [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (Connect()). (53); [08001] [Microsoft][ODBC SQL Server Driver]Atributo de cadeia de conexão inválido (0)’)

---

<div class="post-metadata">

### Author: ![MatheusSantosQA](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/matheussantosqa/32/3359_2.png) [@MatheusSantosQA](https://forum.robotframework.org/u/MatheusSantosQA)
#### Post date: [17 January 2024 14:12 UTC](https://forum.robotframework.org/t/how-to-connect-database-using-robotframework/6674/2 "2024-01-17T14:12:58Z")

</div>

@HelioGuilherme66 Can you help, please ?

---

<div class="post-metadata">

### Author: ![HelioGuilherme66](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/helioguilherme66/32/34_2.png) [@HelioGuilherme66](https://forum.robotframework.org/u/HelioGuilherme66)
#### Post date: [17 January 2024 15:36 UTC](https://forum.robotframework.org/t/how-to-connect-database-using-robotframework/6674/3 "2024-01-17T15:36:32Z")

</div>

Is it connecting with other client?

Check the connection parameters:

- Try to use **named** arguments `port=${PORT}` …
- Try to use a different keyword, `Connect With Custom Settings` (I don’t recall the exact keyword name)
