URL Property Example (VBScript)

Microsoft ActiveX Data Objects (ADO)

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.

…
Sub Update_OnClick
    If ADC.ReadyState <> adcReadyStateLoaded then
        ADC.URL = "RDSSubmit.asp"
        ADC.SubmitChanges
        ADC.Refresh
    Else
        MsgBox "Query results still arriving, Please wait"
    End if
End Sub
…

The server-side code that exists in RDSSubmit.asp submits the updated recordset to the datasource:

<%

Option Explicit

Dim strSQL, strConnection, rstCustomers

strConnection = _
    "Provider=SQLOLEDB;Server=Srv;Database=Pubs;User Id=sa;Password=;"
Set rstCustomers = Server.CreateObject("ADODB.Recordset")

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