Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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;";
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
416 views
Welcome To Ask or Share your Answers For Others

1 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...