Edit

Share via


Cancel method example (VBScript)

Applies to: Access 2013 | Access 2016

The following example shows how to read the Cancel method at run time. Cut and paste the following code to Notepad or another text editor and save it as CancelVBS.asp. You can view the result in any client browser.


<!-- BeginCancelVBS --><Script Language="VBScript">
<!--Sub cmdCancelAsync_OnClick
' Terminates currently running AsyncExecute,' ReadyState property set to adcReadyStateLoaded,
' Recordset set to NothingADC.Cancel
End Sub 
Sub cmdRefreshTable_OnClickADC.Refresh
End Sub-->
</Script> 
<OBJECT CLASSID="clsid:BD96C556-65A3-11D0-983A-00C04FC29E33" ID="ADC">.
<PARAM NAME="SQL" VALUE="Select FirstName, LastName from Employees"><PARAM NAME="CONNECT" VALUE="Provider='sqloledb';Integrated Security='SSPI';Initial Catalog='Northwind'">
<PARAM NAME="Server" VALUE="https://<%=Request.ServerVariables("SERVER_NAME")%>">.
</OBJECT> 
<TABLE DATASRC=#ADC><TBODY>
<TR><TD><SPAN DATAFLD="FirstName"></SPAN></TD>
<TD><SPAN DATAFLD="LastName"></SPAN></TD></TR>
</TBODY></TABLE> 
<FORM><INPUT type="button" value="Refresh" id=cmdRefreshTable name=cmdRefreshTable>
<INPUT type="button" value="Cancel" id=cmdCancelAsync name=cmdCancelAsync></FORM>
<!-- EndCancelVBS -->

See also

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.