Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Persist Security Info Property=true and Persist Security Info Property=false

For the properties:

Persist Security Info=true 

and

Persist Security Info=false 

Can you tell me what is the difference between them, and if I don't put it in my connection what will happen?

connect.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;                             Data Source=C:/Users/Nourah/Downloads                              /Phase3/Salary.accdb;                              Persist Security Info=False;"; 
like image 824
Nourah Avatar asked May 24 '15 02:05

Nourah


People also ask

What is Persist Security Info false?

Use Persist Security Info=False When Persist Security Info is set to false or no , security information is discarded after it is used to open the connection, ensuring that an untrusted source does not have access to security-sensitive information.

What does persist security info mean?

The Persist Security Info string specifies whether the connection persists (caches) the password information used while connecting, and should not be modified.

What does integrated security True mean?

Integrated Security = true : the current Windows account credentials are used for authentication. Integrated Security = SSPI : this is equivalant to true. We can avoid the username and password attributes from the connection string and use the Integrated Security.

What is Integrated Security False?

Integrated Security When false, User ID and Password are specified in the connection. When true, the current Windows account credentials are used for authentication. Recognized values are true, false, yes, no, and sspi (strongly recommended), which is equivalent to true.


2 Answers

Even if you set Persist Security Info=true OR Persist Security Info=false it won't show a difference up front. The difference is happening in the background.

When Persist Security Info=False, security-sensitive information, such as the password, is not returned as part of the connection if the connection is open or has ever been in an open state.

If you set Persist Security Info=True, Windows will remember the password specified in the connection string.

That's the difference.

MSDN Explanation

Setting Persist Security Info true or false will come into effect only if you mention username and password in the connection string. If you mention username and password in the connection string and set Persist Security Info as false then the credentials cannot be extracted, but if you set Persist Security Info as true while giving credentials in the connection string, windows will remember the credentials, and it can be extracted programmatically.

like image 133
Sachu Avatar answered Sep 22 '22 22:09

Sachu


I found this answer here from Dan Guzman, SQL Server MVP:

I suggest you specify FALSE or omit the keyword entirely since it is the default, even during development. The only time you need to specify TRUE is if the application uses SQL authentication and subsequently retrieves the password from the connection object, which in my experience is rarely done or needed. Performance is not a concern.

like image 21
Greg Gum Avatar answered Sep 20 '22 22:09

Greg Gum