加入收藏 | 设为首页 | 会员中心 | 我要投稿 源码网 (https://www.900php.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

oracle – SQLDriverConnect有时会在{}中包含密码时失败

发布时间:2021-01-12 21:42:57 所属栏目:百科 来源:网络整理
导读:根据SQLDriverConnect的 documentation, Because of connection string and initialization file grammar,keywords and attribute values that contain the characters []{}(),;?*=!@ not enclosed with braces should be avoided. 和 A DSN or connection

根据SQLDriverConnect的 documentation,

Because of connection string and initialization file grammar,keywords and attribute values that contain the characters []{}(),;?*=!@ not enclosed with braces should be avoided.

A DSN or connection string value enclosed with braces ({}) containing any of the characters []{}(),;?*=!@ is passed intact to the driver.

使用连接字符串DSN =%s; UID =%s; PWD = {%s}在SQLServer中工作 – 事实上,如果存在某些特殊字符,则不在{}中包含密码失败.但是,对MS Access使用相同的字符串会因“密码无效”而失败,并且在删除{}时有效.它也不适用于Oracle.

如果{}中包含的字符串完整地传递给服务器,那么它不应该工作吗?或者我错过了什么?

解决方法

SQLDriverConnect’s Access-specific page指出:

The PWD keyword should not include any of the special characters (see SQL_SPECIAL_CHARACTERS in SQLGetInfo Returned Values).

在连接到Access并将SQL_SPECIAL_CHARACTERS作为InfoType参数传递时调用SQLGetInfo function应该返回@Andrew Gibson提到的禁用字符.

knowledge base article的“更多信息”部分包含不建议在Access应用程序中使用的特殊字符列表.

IBM的DB2具有相同名称的SQLGetInfo function,具有相同的参数列表,并采用相同的InfoType常量来返回特殊字符,其中列出如下:

all characters except a…z,A…Z,0…9,and underscore

(编辑:源码网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    热点阅读