cancel
Showing results for 
Search instead for 
Did you mean: 

Password in encripted format for sql database in connection string

SOLVED
Highlighted
Contributor

Password in encripted format for sql database in connection string

Hi,

 

I am having connection string for my SQL server where in which i need to enter plain password for connction through database.Is there any way so that i can hide or display that password in encripted format.Below is my connection string code :-

 

var ConnectionString = "DRIVER=SQL Server;SERVER=H_kptest;UID=aaa;PWD=aaa";

 

This password aaa should be in encripted format.

 

Regards,

Naveen

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Hero

Re: Password in encripted format for sql database in connection string

Sure... my intention was in script.  So, what you would do is something like this.

var ConnectionString = "DRIVER=SQL Server;SERVER=H_kptest;UID=aaa;PWD=" + Project.Variables.password.DecryptedValue;

Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

View solution in original post

4 REPLIES 4
Highlighted
Community Hero

Re: Password in encripted format for sql database in connection string

You can store the password in a persistant project variable specifically for a password and then pass in the Decrypted value as a string to that connection string without having to have it open in plain text.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Highlighted
Contributor

Re: Password in encripted format for sql database in connection string

Hi ,

 

I want it through script if we have any approach for that.

 

Regards,

Naveen..

Highlighted
Community Hero

Re: Password in encripted format for sql database in connection string

Sure... my intention was in script.  So, what you would do is something like this.

var ConnectionString = "DRIVER=SQL Server;SERVER=H_kptest;UID=aaa;PWD=" + Project.Variables.password.DecryptedValue;

Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

View solution in original post

Highlighted
Contributor

Re: Password in encripted format for sql database in connection string

Thanks,

This line of code solves my problem.

 

Regards,

Naveen...

New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!

Challenge Status

Changing options from outside of TestComplete

Participate!

How to execute remote test and obtain results via Test Runner REST API

Participate!

Comparing content of HTML table with Excel file data

Participate!

Compare HTML table with Excel file and correct data in the file

Participate!
Top Kudoed Authors