# ODBC connection error while running the script using eggplant manager

**URL:** <https://forums.eggplantsoftware.com/t/odbc-connection-error-while-running-the-script-using-eggplant-manager/7558>\
**Category:** Eggplant Manager\
**Created:** [May 5, 2021, 7:07am UTC](https://forums.eggplantsoftware.com/t/odbc-connection-error-while-running-the-script-using-eggplant-manager/7558 "2021-05-05T07:07:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prasad](https://forums.eggplantsoftware.com/letter_avatar_proxy/v4/letter/p/9de0a6/32.png) [@Prasad](https://forums.eggplantsoftware.com/u/Prasad)\
**Post date:** [May 5, 2021, 7:07am UTC](https://forums.eggplantsoftware.com/t/odbc-connection-error-while-running-the-script-using-eggplant-manager/7558/1 "2021-05-05T07:07:32Z")

</div>

Hi,  
The script has ODBC connection string. I am using eggplant manager to run the script and the script fails with below error.  
“STDatabaseConnectionError Failed to connect to ODBC database odbc:1 Reason: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified, SQLSTATE=IM002”

Not sure what the reason is. If I run the script directly from eggplant functional tool it works fine (DB connection is established). The eggplant server has the ODBC data source setup so does the machine where the Agent is. I am confused what is that I am doing wrong.  
please advise.

---

<div class="post-metadata">

**Author:** ![DaveHester](https://forums.eggplantsoftware.com/user_avatar/forums.eggplantsoftware.com/davehester/32/104_2.png) [@DaveHester](https://forums.eggplantsoftware.com/u/DaveHester)\
**Post date:** [May 5, 2021, 7:01pm UTC](https://forums.eggplantsoftware.com/t/odbc-connection-error-while-running-the-script-using-eggplant-manager/7558/2 "2021-05-05T19:01:31Z")

</div>

Hi Prasad,

When I have seen this before, the issue was that the DSN was not added to the machine that is functioning as the Agent.

Hope this helps,  
Dave

---

<div class="post-metadata">

**Author:** ![Prasad](https://forums.eggplantsoftware.com/letter_avatar_proxy/v4/letter/p/9de0a6/32.png) [@Prasad](https://forums.eggplantsoftware.com/u/Prasad)\
**Post date:** [May 6, 2021, 5:11am UTC](https://forums.eggplantsoftware.com/t/odbc-connection-error-while-running-the-script-using-eggplant-manager/7558/3 "2021-05-06T05:11:00Z")

</div>

Hi Dave,  
Thanks for the response.  
The DNS was added to the machine where Agent is running. Still having the same error.

thanks,  
Prasad

---

<div class="post-metadata">

**Author:** ![Prasad](https://forums.eggplantsoftware.com/letter_avatar_proxy/v4/letter/p/9de0a6/32.png) [@Prasad](https://forums.eggplantsoftware.com/u/Prasad)\
**Post date:** [May 10, 2021, 6:04am UTC](https://forums.eggplantsoftware.com/t/odbc-connection-error-while-running-the-script-using-eggplant-manager/7558/4 "2021-05-10T06:04:13Z")

</div>

Found the solution. I am adding User DNS instead of System DNS. Defining User DNS is fine if the script is running from eggplant functional tool. but to run the script from eggplant manager we should define System DNS.
