ReadyState 属性范例

以下范例说明如何在运行时以 VBScript 代码读取 RDS.DataControl 对象的 ReadyState 属性。ReadyState 为只读属性。

要测试该范例,请剪切该代码并粘贴到标准 HTML 文档的 <Body></Body> 标记之间,然后将其命名为“ADCapi9.asp”。ASP 脚本将标识服务器。

<Center><H2>RDS API Code Examples </H2>
<HR>
<H3> RDS.DataControl ReadyState property</H3></Center>
<!-- 在运行时设置参数的 RDS.DataControl -->
<OBJECT classid="clsid:BD96C556-65A3-11D0-983A-00C04FC29E33"
   ID=ADC>
   <PARAM NAME="SQL" VALUE="Select * from Employee for browse">
   <PARAM NAME="SERVER" VALUE="http://<%=Request.ServerVariables("SERVER_NAME")%>">
   <PARAM NAME="CONNECT" VALUE="dsn=ADCDemo;UID=ADCDemo;PWD=ADCDemo;"> 
<PARAM NAME="ExecuteOptions" VALUE="adcExecAsync"> 
<PARAM NAME="FetchOptions" VALUE="adcFetchAsync">
</OBJECT><Script Language="VBScript">Sub Window_OnLoad
Select Case ADC1.ReadyState
   case 2: MsgBox "Executing Query"
   case 3: MsgBox "Fetching records in background"
   case 4: MsgBox "All records fetched"
End Select
End Sub
</Script>
www.holmesian.org