Your Ad Here
首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 冲浪宝典 > 网络资源 > 终于搞清楚了ADO数据库连接中的Persist Security Info参数的作用
【标  题】:终于搞清楚了ADO数据库连接中的Persist Security Info参数的作用
【关键字】:ADO,Persist,Security,Info
【来  源】:http://blog.csdn.net/yzsind/archive/2007/02/11/1507717.aspx

终于搞清楚了ADO数据库连接中的Persist Security Info参数的作用

Your Ad Here

 终于搞清楚了ADO数据库连接中的Persist Security Info参数的作用

ADO用了这么久,每次用向导创建ADO的数据库连接字符串时总会有产生一个Persist Security Info属性,平时没太注意,因为设置为True或False时对数据库连接没有任何影响。不过心理还是不爽,今天有时间查询了一下资料,总算搞清楚了它的作用。

Persist Security Info属性的意思是表示是否保存安全信息,其实可以简单的理解为"ADO在数据库连接成功后是否保存密码信息",

True表示保存,False表示不保存

ADO缺省为True
(ADO.net缺省为False,未测试,根据参考资料上说的)

具体可以通过ADO的Connect对象的ConnectString属性进行验证,如下所示(以下在Delphi7中测试通过):

----------------------------------------------------------------------------------------------------------

数据库连接前

ConnectString="Provider=MSDAORA.1;Password=mypassword;User ID=yzs;Data Source=ydgl22;Persist Security Info=false"

数据库连接成功后

ConnectString="Provider=MSDAORA.1;User ID=yzs;Data Source=ydgl22"

----------------------------------------------------------------------------------------------------------

数据库连接前

ConnectString="Provider=MSDAORA.1;Password=mypassword;User ID=yzs;Data Source=ydgl22;Persist Security Info=true"

数据库连接成功后

ConnectString="Provider=MSDAORA.1;Password=mypassword;User ID=dlyx;Data Source=ydgl22"

----------------------------------------------------------------------------------------------------------

 总体来说,如果数据库连接成功后不再需要连接的密码,出于安全性考虑,还是建议将Persist Security Info设为false,以防止后门程序取得数据库连接的密码(windows2003在sp1前就发生过这个问题)。

以下是摘自微软的ADO.net资料

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconsecureadonetconnections.asp

Keep Persist Security Info as False

Setting Persist Security Info to true or yes will allow security-sensitive information, including the userid and password, to be obtained from the connection after the connection has been opened. If you are supplying a userid and password when making a connection, you are most protected if that information is used to open the connection, and then discarded. As a result, your option that helps to provide greater security is to set Persist Security Info to false or no.

This is especially important if you are supplying an open connection to an untrusted source or persisting connection information to disk. Keeping Persist Security Info as false helps ensure that the untrusted source does not have access to the security-sensitive information for your connection and also helps ensure that no security-sensitive information is persisted to disk with your connection string information.

Persist Security Info is false by default.

 

 

ORACLE 11g新特性中文版:【上一篇】
思维导图---SQL Queries for Mere Mortals (1 - 4章):【下一篇】
【相关文章】
  • Hadoop-- 海量文件的分布式计算处理方案
  • 让你的Winform应用在运行时可自由拖放控件位置
  • 利用VC和ADO接口编写一个dll模块实现对数据库数据的处理
  • Hadoop--海量文件的分布式计算处理方案
  • informix竖表转横表实现过程
  • ADO and Python (0-3)
  • ADO and Python (4-5)
  • ADO and Python (6-7)
  • ADO and Python (8-9)
  • ADO and Python (10-11)
  • 【随机文章】
  • 反省。。。。。。
  • 制作俄罗斯方块益智游戏(1)
  • Linux9 + Qmail + Webmail 安装全过程
  • jdk1.5新特性
  • DB2双机安装全过程的详细解析
  • WebPage类的源代码
  • 等轴测投影中的文字
  • 全国计算机等级考试二级Visual Basic考试大纲
  • PowerSuite的开发路线
  • 中断处理和系统调用
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 bbb软讯网络 All Rigths Reserved.