当前位置: 首页 > 网络学院 > 服务端脚本教程 > ADO > ADO CommandTimeout 属性
The CommandTimeout property sets or returns the number of seconds to wait while attempting to execute a command, before canceling the attempt and generate an error. Default is 30.
CommandTimeout属性的作用是:在取消指令执行或执行指令出错之前设置或返回等待一条指令执行的时间(单位:秒),默认值为30(秒)。
object.CommandTimeout |
For a Command object: <% set conn=Server.CreateObject("ADODB.Connection") conn.Provider="Microsoft.Jet.OLEDB.4.0" conn.Open "c:/webdata/northwind.mdb" set comm=Server.CreateObject("ADODB.Command") comm.CommandTimeout=10 response.write(comm.CommandTimeout) conn.close %> For a Connection object: <% set conn=Server.CreateObject("ADODB.Connection") conn.Provider="Microsoft.Jet.OLEDB.4.0" conn.Open "c:/webdata/northwind.mdb" conn.CommandTimeout=10 response.write(conn.CommandTimeout) conn.close %> |