Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE
     ❯   

ADO WillConnectConnectCompleteDisconnect 事件


❮ 完整连接对象参考

事件是可以在特定操作发生后自动调用的子例程。

  • WillConnect 事件可以在连接开始之前触发。
  • ConnectComplete 事件可以在连接开始之后触发。
  • Disconnect 事件可以在连接结束之后触发。

语法

WillConnect ConnectionString,userid,psword,options,status,objcon

ConnectComplete objerror,status,objconn

Disconnect status,objconn

参数 描述
ConnectionString 包含连接所需信息的字符串
userid 包含连接用户名 的字符串
psword 包含连接密码 的字符串
options 指定提供程序应如何评估 ConnectionString 的长整型值。只能设置为 adAsyncOpen
objerror 包含发生的错误的 Error 对象

注意: 必须将 EventStatusEnum 值设置为 adStatusErrorsOccurred 以创建 Error 对象

status 一个 EventStatusEnum 值。默认值为 adStatusOK

但是,当调用 ConnectComplete 事件时,如果 WillConnect 事件调用取消挂起的连接,则此参数将设置为 adStatusCancel

objconn 触发事件的 Connection 对象 

EventStatusEnum 值

常量 描述
adStatusOK 1 触发事件的操作成功
adStatusErrorsOccurred 2 触发事件的操作失败
adStatusCantDeny 3 无法取消挂起的操作
adStatusCancel 4 取消触发事件的操作
adStatusUnwantedEvent 5 在事件方法完成执行之前阻止后续通知

❮ 完整连接对象参考
×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
[email protected]

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
[email protected]

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.

Copyright 1999-2024 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.