# ADO connection string to hit SQL Server msdb database?

**URL:** https://www.finalbuilder.com/forums/t/ado-connection-string-to-hit-sql-server-msdb-database/4589
**Category:** Discussion
**Created:** [December 9, 2014, 7:25am UTC](https://www.finalbuilder.com/forums/t/ado-connection-string-to-hit-sql-server-msdb-database/4589 "2014-12-09T07:25:44Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![jonathanmeltzer](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/j/34f0e0/32.png) [@jonathanmeltzer](https://www.finalbuilder.com/forums/u/jonathanmeltzer)
#### Post date: [December 9, 2014, 7:25am UTC](https://www.finalbuilder.com/forums/t/ado-connection-string-to-hit-sql-server-msdb-database/4589/1 "2014-12-09T07:25:44Z")

</div>

Greetings! &nbsp;I have a Perl script that selects from the SQL Server msdb database, and I am attempting to port the logic of that script into Automise. &nbsp;The Perl script does not need a user ID and a password to select from the msdb database, and so I am trying to set up the ADO Iterator the same way. &nbsp;Unfortunately, I cannot figure out a way to do this. &nbsp;I have tried setting up the UserID and Password fields to be blank, as in:  
  
Provider=SQLOLEDB.1;Persist Security Info=True; **User ID=;Password=** ;Initial Catalog=msdb;Data Source=CTDB  
  
I have also tried removing the User ID and Password fields altogether, and trying it with a User ID of sa and no password.  
  
None of these work…any idea what I am missing? &nbsp;Can an ADO connection hit that database?  
  
Thanks,  
  
Jonathan

---

<div class="post-metadata">

### Author: ![jonathanmeltzer](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/j/34f0e0/32.png) [@jonathanmeltzer](https://www.finalbuilder.com/forums/u/jonathanmeltzer)
#### Post date: [December 9, 2014, 7:55am UTC](https://www.finalbuilder.com/forums/t/ado-connection-string-to-hit-sql-server-msdb-database/4589/2 "2014-12-09T07:55:30Z")

</div>

Solved it. The correct connection string to use is:   
  
 Driver={SQL Server};Server=CTDB;Trusted\_Connection=Yes;Database=msdb;

---

<div class="post-metadata">

### Author: ![nevar](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/n/c4cdca/32.png) [@nevar](https://www.finalbuilder.com/forums/u/nevar)
#### Post date: [December 9, 2014, 11:01am UTC](https://www.finalbuilder.com/forums/t/ado-connection-string-to-hit-sql-server-msdb-database/4589/3 "2014-12-09T11:01:15Z")

</div>

Hi Jonathan,   
  
 Great to hear. Glad this is now working for you.

---

<div class="post-metadata">

### Author: ![jonathanmeltzer](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/j/34f0e0/32.png) [@jonathanmeltzer](https://www.finalbuilder.com/forums/u/jonathanmeltzer)
#### Post date: [December 10, 2014, 2:37am UTC](https://www.finalbuilder.com/forums/t/ado-connection-string-to-hit-sql-server-msdb-database/4589/4 "2014-12-10T02:37:46Z")

</div>

Well…it is and it isn’t. &nbsp;It worked when I ran the action list manually inside of Automise (likely because of the permissions I have on the server), but it failed when run as part of an automated process last night. &nbsp;I assume that the user that it tries to execute under is the user that is running the Automise command-line? &nbsp;I will try a tweak of that user’s permissions to see what I can do.&nbsp;

---

<div class="post-metadata">

### Author: ![jonathanmeltzer](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/j/34f0e0/32.png) [@jonathanmeltzer](https://www.finalbuilder.com/forums/u/jonathanmeltzer)
#### Post date: [December 11, 2014, 4:41am UTC](https://www.finalbuilder.com/forums/t/ado-connection-string-to-hit-sql-server-msdb-database/4589/5 "2014-12-11T04:41:01Z")

</div>

That worked. &nbsp;I gave the logged-in user permissions on the database, and it ran fine last night.
