To test this example, cut and paste this code between the <Body> and </Body> tags in a normal HTML document and name it CancelUpdateVBS.asp. ASP script will identify your internet server. You will need to edit the name of the server to reflect your own setup. Simply change the value in the connect string from MyServer to the name of your SQL Server installation.
<!-- BeginCancelUpdateVBS --> <HTML> <HEAD> <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0"> <TITLE></TITLE> </HEAD> <BODY> <Center> <H2>RDS API Code Examples</H2> <HR> <H3>Remote Data Service SubmitChanges and CancelUpdate Methods</H3> <!-- RDS.DataControl with parameters set at design time --> <OBJECT classid="clsid:BD96C556-65A3-11D0-983A-00C04FC29E33" ID=RDS HEIGHT=1 WIDTH=1> <PARAM NAME="SQL" VALUE="Select * from Employees"> <PARAM NAME="SERVER" VALUE="http://<%=Request.ServerVariables("SERVER_NAME")%>"> <PARAM NAME="CONNECT" VALUE="Provider=SQLOLEDB;Data Source=MyServer;User Id=sa;Password=;Initial Catalog=Northwind"> </OBJECT> <TABLE DATASRC="#RDS"> <THEAD> <TR ID="ColHeaders"> <TH>ID</TH> <TH>FName</TH> <TH>LName</TH> <TH>Title</TH> <TH>Hire Date</TH> <TH>Birth Date</TH> <TH>Extension</TH> <TH>Home Phone</TH> </TR> </THEAD> <TBODY> <TR> <TD> <INPUT DATAFLD="EmployeeID" size=4> </TD> <TD> <INPUT DATAFLD="FirstName" size=10> </TD> <TD> <INPUT DATAFLD="LastName" size=10> </TD> <TD> <INPUT DATAFLD="Title" size=20> </TD> <TD> <INPUT DATAFLD="HireDate" size=10> </TD> <TD> <INPUT DATAFLD="BirthDate" size=10> </TD> <TD> <INPUT DATAFLD="Extension" size=10> </TD> <TD> <INPUT DATAFLD="HomePhone" size=8> </TD> </TR> </TBODY> </TABLE> <HR> <INPUT TYPE=BUTTON NAME="SubmitChange" VALUE="Submit Changes"><INPUT TYPE=BUTTON NAME="CancelChange" VALUE="Cancel Update"><BR> <H4>Add a new person or alter a current entry on the grid. Move off that Row. <BR> Submit the Changes to your DBMS or cancel the updates. </H4> </Center> <Script Language="VBScript"> <!-- ' Set parameters of RDS.DataControl at Run Time Sub SubmitChange_OnClick RDS.SubmitChanges RDS.Refresh End Sub Sub CancelUpdate_OnClick RDS.CancelUpdate End Sub --> </Script> </BODY> </HTML> <!-- EndCancelUpdateVBS -->