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

delphi – TADOQuery准备好了

发布时间:2020-12-15 09:33:50 所属栏目:大数据 来源:网络整理
导读:TADOQuery组件具有“准备”属性,手册说当准备好设置为TRUE时,ADO’准备’命令,这意味着什么? 这是手册解释: Set Prepared before calling the Execute method to specify whether ADO prepares the command. If Prepared is set to True and the command c
TADOQuery组件具有“准备”属性,手册说当准备好设置为TRUE时,ADO’准备’命令,这意味着什么?

这是手册解释:

Set Prepared before calling the Execute method to specify whether ADO
prepares the command. If Prepared is set to True and the command
component is connected to a data store,ADO prepares the command
before executing it. If Prepared is set to False,ADO does not prepare
the command.

它将参数注入SQL Text?

解决方法

以下是Delphi 2007帮助文件中的一些更好的文档:

Use the Prepared property to have the provider save a prepared (or compiled) version of the query specified in the CommandText property before a Command object’s first execution. This may slow a command’s first execution,but once the provider compiles a command,the provider will use the compiled version of the command for any subsequent executions,which will result in improved performance.

If the property is False,the provider will execute the Command object directly without creating a compiled version.

If the provider does not support command preparation,it may return an error when this property is set to True. If the provider does not return an error,it simply ignores the request to prepare the command and sets the Prepared property to False.

这基本上表示编译了SQL语句(预解析并标记化和分析).当查询被多次使用时,每次只需替换参数值就可以使用这个编译版本,而不必重新编译所有语句并完成其他工作.

(编辑:李大同)

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

    推荐文章
      热点阅读