RDS API Reference

URL Property Example (VBScript)

The following code demonstrates how to set the URL property on the client side to specify an .asp file that in turn handles the submission of changes to the data source.

<!-- BeginURLClientVBS -->
<%@ Language=VBScript %>
<html>
<head>
    <meta name="VI60_DefaultClientScript"  content=VBScript>
    <meta name="GENERATOR" content="Microsoft Visual Studio 6.0">
    <title>URL Property Example (VBScript)</title>
<style>
<!--
body {
   font-family: 'Verdana','Arial','Helvetica',sans-serif;
   BACKGROUND-COLOR:white;
   COLOR:black;
    }
.thead {
   background-color: #008080; 
   font-family: 'Verdana','Arial','Helvetica',sans-serif; 
   font-size: x-small;
   color: white;
   }
.thead2 {
   background-color: #800000; 
   font-family: 'Verdana','Arial','Helvetica',sans-serif; 
   font-size: x-small;
   color: white;
   }
.tbody { 
   text-align: center;
   background-color: #f7efde;
   font-family: 'Verdana','Arial','Helvetica',sans-serif; 
   font-size: x-small;
    }
-->
</style>
</head>

<body>
<h1>URL Property Example (VBScript)</h1>
<OBJECT classid=clsid:BD96C556-65A3-11D0-983A-00C04FC29E33 height=1 id=ADC width=1>
<PARAM NAME="SQL" VALUE="Select * from Employees for browse">
<PARAM NAME="Connect" VALUE="Provider=SQLOLEDB;User Id=sa;Password=;Initial Catalog=Northwind">
<PARAM NAME="Server" VALUE="http://<%=Request.ServerVariables("SERVER_NAME")%>">
</OBJECT>

<table datasrc="#ADC" align="center">
<thead>
<tr id="ColHeaders" class="thead2">
   <th>FirstName</th>
   <th>LastName</th>
   <th>Extension</th>
</tr>
</thead>
<tbody class="tbody">
<tr>
   <td><input datafld="FirstName" size=15> </td>
   <td><input datafld="LastName" size=25> </td>
   <td><input datafld="Extension" size=15> </td>
</tr>
</tbody>
</table>
<p align="center">
<INPUT type="submit" value="Update" id=Update name=Update>
</p>

<script Language="VBScript">
Sub Update_OnClick
   If ADC.ReadyState <> adcReadyStateLoaded then
      ADC.URL = "URLServerVBS.asp"
      ADC.SubmitChanges
      ADC.Refresh
   Else
      MsgBox "Query results still arriving, Please wait"
   End if
End Sub
</script>



</body>
</html>
<!-- EndURLClientVBS -->

The server-side code that exists in RDSSubmit.asp submits the updated Recordset to the data source.

!<-- BeginURLServerVBS -->
<%@ Language=VBScript %>
<html>
<head>
    <meta name="VI60_DefaultClientScript"  content=VBScript>
    <meta name="GENERATOR" content="Microsoft Visual Studio 6.0">
    <title>URL Property Example (VBScript)</title>
<style>
<!--
body {
   font-family: 'Verdana','Arial','Helvetica',sans-serif;
   BACKGROUND-COLOR:white;
   COLOR:black;
    }
.thead {
   background-color: #008080; 
   font-family: 'Verdana','Arial','Helvetica',sans-serif; 
   font-size: x-small;
   color: white;
   }
.thead2 {
   background-color: #800000; 
   font-family: 'Verdana','Arial','Helvetica',sans-serif; 
   font-size: x-small;
   color: white;
   }
.tbody { 
   text-align: center;
   background-color: #f7efde;
   font-family: 'Verdana','Arial','Helvetica',sans-serif; 
   font-size: x-small;
    }
-->
</style>
</head>

<body>
<h1>URL Property Example (VBScript)</h1>

<%

Option Explicit

Dim strSQL, strConnection, rstEmployees

strConnection = _
   "Provider=SQLOLEDB;Server=a-iresmi2000;Database=Northwind;User Id=sa;Password=;"
Set rstCustomers = Server.CreateObject("ADODB.Recordset")

On Error Resume Next
rstEmployees.Open Request
rstEmployees.ActiveConnection = strConnection
rstEmployees.UpdateBatch
If Err.Number <> 0 Then
   Request.Status = "500 " + Err.Source + ": " + Err.Description
End If
%>

</body>
</html>
<!-- EndURLServerVBS -->

See Also

URL Property (RDS)