Server Property Example (VBScript)
In this article
The following code shows how to set the RDS.DataControl parameter at design time and bind it to a data-aware control using the SQLOLEDB provider. Cut and paste this code into a normal ASP document and name it ServerDesignVBS.asp . ASP script will identify your server.
<!-- BeginServerDesignVBS -->
<meta name="VI60_DefaultClientScript" content=VBScript>
<meta name="GENERATOR" content="Microsoft Visual Studio 6.0">
<title>Server Property Example (VBScript)</title>
font-family: 'Verdana','Arial','Helvetica',sans-serif;
background-color: #008080;
font-family: 'Verdana','Arial','Helvetica',sans-serif;
background-color: #800000;
font-family: 'Verdana','Arial','Helvetica',sans-serif;
background-color: #f7efde;
font-family: 'Verdana','Arial','Helvetica',sans-serif;
<h1>Server Property Example (VBScript)</h1>
<TD> <SPAN DATAFLD="FirstName"></SPAN> </TD>
<TD> <SPAN DATAFLD="LastName"></SPAN> </TD>
<TD> <SPAN DATAFLD="Title"></SPAN> </TD>
<TD> <SPAN DATAFLD="Type"></SPAN> </TD>
<TD> <SPAN DATAFLD="Email"></SPAN> </TD>
<!-- Remote Data Service with Parameters set at Design Time -->
<OBJECT classid="clsid:BD96C556-65A3-11D0-983A-00C04FC29E33"
<PARAM NAME="SQL" VALUE="Select * from Employees">
<PARAM NAME="SERVER" VALUE="http://<%=Request.ServerVariables("SERVER_NAME")%>">
<PARAM NAME="CONNECT" VALUE="Provider='sqloledb';Integrated Security='SSPI';Initial Catalog='Northwind'">
<!-- EndServerDesignVBS -->
The following example shows how to set the necessary parameters of RDS.DataControl at run time. To test this example, cut and paste this code into a normal ASP document and name it ServerRuntimeVBS.asp . ASP script will identify your server.
<!-- BeginServerRuntimeVBS -->
<meta name="VI60_DefaultClientScript" content=VBScript>
<meta name="GENERATOR" content="Microsoft Visual Studio 6.0">
<title>Server Property Example (VBScript)</title>
font-family: 'Verdana','Arial','Helvetica',sans-serif;
background-color: #008080;
font-family: 'Verdana','Arial','Helvetica',sans-serif;
background-color: #800000;
font-family: 'Verdana','Arial','Helvetica',sans-serif;
background-color: #f7efde;
font-family: 'Verdana','Arial','Helvetica',sans-serif;
<h1>Server Property Example (VBScript)</h1>
<H2>RDS API Code Examples</H2>
<H3>Remote Data Service Server Property Set at Run Time</H3>
<!-- RDS.DataControl with no parameters set at design time -->
<OBJECT classid="clsid:BD96C556-65A3-11D0-983A-00C04FC29E33"
<TD> <SPAN DATAFLD="FirstName"></SPAN> </TD>
<TD> <SPAN DATAFLD="LastName"></SPAN> </TD>
<TD> <SPAN DATAFLD="Title"></SPAN> </TD>
<TD> <SPAN DATAFLD="Type"></SPAN> </TD>
<TD> <SPAN DATAFLD="Email"></SPAN> </TD>
<Input Size=70 Name="txtServer" Value="HTTP://<%= Request.ServerVariables("SERVER_NAME")%>">
<Input Size=70 Name="txtConnect" Value="Provider='sqloledb';Integrated Security='SSPI';Initial Catalog='Northwind'">
<Input Size=70 Name="txtSQL" Value="Select * from Employees">
<INPUT TYPE=BUTTON NAME="Run" VALUE="Run"><BR>
<Script Language="VBScript">
' Set parameters of RDS.DataControl at Run Time
RDC.Server = txtServer.Value
RDC.Connect = txtConnect.Value
<!-- EndServerRuntimeVBS -->
DataControl Object (RDS) | Server Property (RDS)