username password management

Automation needs to connect to the database and this is first automation. How can I pass password in connection string. Password is encrypted or taken from credential manager as parameter.


  • Hi Kamal

    Set up your entire connection string in the credential value and when you use open the connection the DB the connection you choose is the one in the credential vault.

    So for instance, I create a credential vault connection string like this :

    Provider=SQLOLEDB.1;Password=ThisP@55Word;Persist Security Info=True;User ID=MYAAUSER;Initial Catalog=MYAADB;Data Source=MYAAMACHINE\AACRSQLEXPRESS

    So in this case, we are connecting to the SQL Server instance AACRSQLEXPRESS on the machine MYAAMACHINE

    The database we are connecting to is MYAADB and the password is ThisP@55Word

    So I use that to create the credential vault variable called DBConn

    When I then go into my client, and connect to the database, I can now see the Credential Variable, DBConn with the attribute DBConn which is my entire connection string


    I have some code here to test the connection to make sure I'm connecting to the correct server, database and that the date is today:

    1 Connect to "$DBConn(DBConn)$" Session:'Default'
    @servername, db_name(), getdate()' Session:'Default'
    3 Start Loop "Each row in SQL Data Set Session: Default"
    4 Comment: Please enter your commands to loop. Use $Dataset Column$ variable for each record in Dataset.
    5 Message Box: "Servername: $Dataset Column(1)$Database: $Dataset Column(2)$Date: $Dataset Column(3)$"
    6 End Loop

    Hope this helps.

    Kind regards


  • Thanks Damian. That helps.

Sign In or Register to comment.