ReadyState Property Example

The following example shows how to read the ReadyState property of the RDS.DataControl object at run time in VBScript code. ReadyState is a read-only property.

To test this example, cut and paste this code between the <Body></Body> tags in a normal HTML document and name it ADCapi9.asp. ASP script will identify your server.

<Center><H2>RDS API Code Examples </H2>
<HR>
<H3> RDS.DataControl ReadyState property</H3></Center>
<!-- RDS.DataControl with parameters set at design time -->
<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>