当前位置: 首页 > 网络学院 > 服务端脚本教程 > ADO > ADO WillConnect, ConnectComple

ADO
ADO DataTypes
ADO 摘要
ADO 实例

ADO WillConnect, ConnectComple


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 373 ::
收藏到网摘: n/a

An event is a subroutine that can be called automatically after a specific operation has occurred.
事件就是在一个具体操作发生之后自动请求的一个字程序。

  • The WillConnect event can be fired before a connection starts.
    WillConnect事件可以在一个连接开始之前激发
  • The ConnectComplete event can be fired after a connection starts.
    ConnectComplete事件可以在连接开始之后激发
  • The Disconnect event can be fired after a connection ends.
    Disconnect事件可以在连接结束之后激发

Syntax
语法

WillConnect ConnectionString,userid,psword,options,status,objcon
ConnectComplete objerror,status,objconn
Disconnect status,objconn

Parameter参数 Description描述
ConnectionString A string that contains the information required for the connection
指定一个包含了连接所需信息的字符串
userid A string that contains the user name for the connection
指定一个包含连接用户名的字符串
psword A string that contains the password for the connection
指定一个包含连接密码的字符串
options A long value that specifies how the provider should evaluate the ConnectionString. Can only be set to adAsyncOpen
指定一个长值,用于指定技术提供对象[provider]如何对ConnectionString进行评估。它的值只能被设置为adAsyncOpen
objerror An Error object that contains the errors that occurred
包含所发生的错误的Error对象

Note: The EventStatusEnum value must be set to adStatusErrorsOccurred to create the Error object
注意:EventStatusEnum值必须被设置为adStatusErrorsOccurred以创建Error对象

status An EventStatusEnum value. Default is adStatusOK
指定一个EventStatusEnum值。默认值为adStatusOK

However, when the ConnectComplete event is called, this parameter is set to adStatusCancel IF a WillConnect event calls for cancelling of the pending connection
然而,当请求ConnectComplete事件时,如果WillConnect事件请求取正在处理中的连接,这个参数需要被设置为adStatusCancel

objconn The Connection object that fired the event 
用于激发事件的连接对象


EventStatusEnum Values

Constant 常量 Value值 Description描述
adStatusOK 1 The operation that fired the event was successful
激发事件操作成功
adStatusErrorsOccurred 2 The operation that fired the event failed
激发事件操作失败
adStatusCantDeny 3 Cannot cancel the pending operation
不可以取消正处于处理执行中的操作
adStatusCancel 4 Cancels the operation that fired the event
取消激发事件的操作
adStatusUnwantedEvent 5 Prevents subsequent notifications before the event method has finished executing
在时间的运行方法终止运行之前禁止后续的报告

评论 (0) All

登陆 | 还没注册?