Damir Arh's Corner
Search
Categories
  Development
 .NET
 Batch
 C++
 SQL
 VB6
 Vista
 Web
 Win32
  Downloads
 Amiga
 Articles
 Presentations
 Sources
 Windows
  Personal
 Education
 Software
 Website
Archives
July, 2008 (1)
June, 2008 (1)
April, 2008 (2)
December, 2007 (1)
November, 2007 (3)
July, 2007 (4)
June, 2007 (1)
May, 2007 (2)
March, 2007 (3)
January, 2007 (1)
December, 2006 (4)
October, 2006 (5)
September, 2006 (3)
August, 2006 (2)
June, 2006 (8)
May, 2006 (5)
April, 2006 (1)
March, 2006 (4)
February, 2006 (3)
January, 2006 (3)
March, 2003 (1)
February, 2002 (1)
January, 2002 (2)
August, 2001 (1)
July, 2001 (1)
February, 2001 (1)
December, 2000 (1)
September, 2000 (1)
July, 2000 (1)
Other Sites
Potepanja v naravi (sl)
Picasa Web Albums (sl)
moj-album.com Gallery (sl)
Bolha.com Auctions (sl)
My Game Space
LinkedIn Public Profile
My GamerTag
Sponsored Links
Administration
Sign In
Sunday, March 25, 2007

Persist Security Info default value changed in Windows Vista (Development | VB6)

In Windows Vista the default value for the Persist Security Info parameter of an ADO connection string has changed from True to False.

You should be aware of this because it can prevent your legacy code from working properly under Windows Vista. If its value is set to False the Server, Database, Trusted_Connection and Password parameters will be removed from the ConnectionString property of the Connection object once the connection has been opened. If you’re creating new connections by just copying the ConnectionString property from an existing and already opened connection to the new one, your code will break under Vista.

The problem can easily be fixed by explicitly setting Persist Security Info to True in your original connection string but it should be mentioned that this can be a potential security risk if untrusted code gets access to your Connection object. Even more so in case you’re not using integrated security and the connection string actually contains the user’s password for accessing the database. It’s a much better practice to have the actual connection string stored separately and use it directly to create new connections.

On a side note, SqlClient in ADO.NET works much more consistently. The Persist Security Info parameter always defaults to False. It also only removes the Password parameter from the ConnectionString property which makes changing its value to True completely unnecessary unless you really feel a strong urge to share your user’s password.

3/25/2007 8:48:05 AM (Central Europe Standard Time, UTC+01:00)  #  Comments [2]

2/26/2008 12:44:52 PM (Central Europe Standard Time, UTC+01:00)
Hi Darmir.
I have add the "persist security info=True", but the problem still remain.
My connection string it is:
Provider=SQLNCLI.1;Persist Security Info=True;User Id=sa;Data Source=Server\Db;Use Procedure for Prepare=1;Auto Translate =True;Packet Size=4096;Workstation Id=xxxxx;Use Encryption for Data=False;Tag with column collation when possible=False;MARS Connection=False;DataTypeCompatibility=0;Trust Server Certificate=False;;

I use a sql server 2005 express edition database.
Any idea?
Ciao
Dedalus |ulysseAT NOSPAMemail dot it
3/26/2008 6:08:15 PM (Central Europe Standard Time, UTC+01:00)
Hi Darmir:

That fixed worked great for me for connection to a sql server db, thanks! However, the application I support also interacts with MS Access dbs, and the same Vista problem seems to be affecting the ado connection. If I add "persist security info=True" to the connection string or set the connection.properties("persist security info=True") to true, it still isn't working, and the connection's connection string doesn't keep that property. Any idea what I need to do to fix this?

Thanks,
Mark
Mark |marknAT NOSPAMstudioplussoftware dot com
Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):

Blog Feeds
RSS 2.0 RSS 2.0
Atom 1.0 ATOM 1.0
Fellow Bloggers
 Andrej Tozon
 Dejan Sarka
 Dusan Zupancic
 Matevz Gacnik
 Miha Markic
Disclaimer
The content of this site are my own personal opinions and do not represent my employer's view in anyway. In addition, my thoughts and opinions often change, and as a weblog is intended to provide a semi-permanent point in time snapshot you should not consider out of date posts to reflect my current thoughts and opinions.

Powered by:
newtelligence dasBlog 1.8.5223.2

© 2008 Damir Arh, M. Sc. Send mail to the author(s)

Microsoft Certified Professional
Currently Reading
Currently Playing
Currently Watching