This is the remote scripting file used by RSCombos and RSTreeView.htm. Note:that with the remote scripting samples there is a hard-coded path to the relevant support files, this will have to be changed appropriately for people to get the demos to work on their own system. These demo's only work with Internet Explorer 5.0. First Page--RSCombos.htm <HTML> <HEAD> <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0"> <TITLE>Two Combos using Remote Scripting</TITLE> </HEAD> <BODY> <!-- Author: Adrian Forbes --> <script language="JavaScript" src="../_scriptlibrary/rs.htm"></script> <script language="JavaScript">RSEnableRemoteScripting("../_scriptlibrary"); </script> <p> <select onChange="PopulateChildren()" name=cboParents ID=cboParent size=1> </select><select name=cboChildren ID=cboChildren size=1></select> </p>
<script language=VBScript> strDBPage = "RSDatabase.asp"
sub Window_onLoad PopulateParent PopulateChildren end sub
sub PopulateParent
set objParents = document.all("cboParents") set objRS = RSExecute(strDBPage ,"GetDBParents") sRS = objRS.return_value aRows = Split(sRS, Chr(13))
for i = 0 to UBound(aRows) - 1 aFields = Split(aRows(i), ";") set objOption = document.createElement ("OPTION") objOption.Value = aFields(0) objOption.Text = aFields(1) objParents.add objOption next end sub
sub PopulateChildren set objParents = document.all("cboParents") set objChildren = document.all("cboChildren") while objChildren.length > 0 objChildren.remove (0) wend set objRS = RSExecute(strDBPage ,"GetDBChildren", objParents.value) sRS = objRS.return_value aRows = Split(sRS, Chr(13))
for i = 0 to UBound(aRows) - 1 aFields = Split(aRows(i), ";") set objOption = document.createElement ("OPTION") objOption.Value = aFields(0) objOption.Text = aFields(1) objChildren.add objOption next end sub </script> </BODY> </HTML> Page 2 RSDatabase.asp <%@ LANGUAGE=VBSCRIPT %> <% strconn = "Driver={SQL Server};Description=sqldemo;SERVER=127.0.0.1; UID=LoginID;PWD=Password;DATABASE=Database_Name %> <% RSDispatch %> <!-- Author: Adrian Forbes --> <!--#INCLUDE FILE="../_ScriptLibrary/rs.asp"--> <SCRIPT RUNAT=SERVER Language=javascript> function Description() { this.GetDBParents = Function( 'return GetDBParents()' ); this.GetDBChildren = Function('ID', 'return GetDBChildren(ID)' ); this.Method1 = Method1; } public_description = new Description();
function Method1() { return 'Test'; } </script>
<SCRIPT RUNAT=SERVER Language=VBScript> function GetDBParents()
set objRS = createobject("ADODB.Recordset") objRS.Open "select ID, strParent from Parents", strconn GetDBParents = objRS.GetString(, , ";") objRS.Close set objRS.ActiveConnection = nothing set objRS = nothing end function
function GetDBChildren(ID)
set objRS = createobject("ADODB.Recordset") objRS.Open "select ID, strChild from Children WHERE intParent=" & ID, strconn GetDBChildren = objRS.GetString(, , ";") objRS.Close set objRS.ActiveConnection = nothing set objRS = nothing end function </SCRIPT>
|
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |
More ASP Code Articles More By Adrian Forbes developerWorks - FREE Tools! | Attend this launch webcast with Scott Hebner, Vice President of IBM Rational Marketing and Strategy, for an overview of Rational’s new software offerings and resources to help modernize and accelerate software innovation on i on Power Systems – while ensuring past application investments are protected and continue to grow. Learn how these solutions are helping customers extend their core i5/OS solutions toward modern architectures such as SOA and web technologies to deliver business improvements that stand the test of time. FREE! Go There Now!
| | | | This tutorial shows new users of IBM WebSphere Business Monitor Version 6.0.2 how to perform the "Hello World" equivalent for monitoring business process applications. It is intended to help you get familiar with the capabilities of the product. FREE! Go There Now!
| | | | Secure your Web applications with IBM Rational AppScan Standard Edition V7.7, previously known as Watchfire AppScan. This Web application security testing tool automates vulnerability assessments and scans and tests for common Web application vulnerabilities. Visit IBM developerWorks to download a free trial of IBM Rational AppScan Standard Edition V7.7. FREE! Go There Now!
| | | | Learn how Rational Build Forge can extend a simple compile and package build process by adding customization and deployment capability. Go from a manual method to automating: checking for code changes; getting the latest source; compiling and packaging; customizing; copying to and restarting a deployment server; and sending e-mail notification that a new version is available. FREE! Go There Now!
| | | | Ken Krugler, co-founder of code search company Krugle, and Laura Merling, vice president of Marketing and Business Development for Krugle, join to talk about the ins and outs of code search and what it means as a new feature for developerWorks users. FREE! Go There Now!
| | | | This webcast outlines the best practices that must be instituted to gain the maximum benefit from SOA while maintaining high quality of service. Whether you are deploying new applications or managing and monitoring your existing infrastructure, learn how you can ensure high quality of services with SOA based solutions from IBM. All registrants who attend this live Web Seminar will receive complimentary access to a white paper titled “Maintaining QoS in an SOA Environment”. FREE! Go There Now!
| | | | Get a free trial download of the latest version of IBM Rational Functional Tester V7.0.1. Rational Functional Tester is an automated functional and regression testing solution for QA teams concerned with the quality of their Java, Microsoft Visual Studio .NET, and Web-based applications. FREE! Go There Now!
| | | | Get a free trial download of the latest version of IBM Rational Tester for SOA Quality V7.0.1, a functional and regression testing tool that enables the creation, comprehension, modification and execution of testing GUI-less Web services. FREE! Go There Now!
| | | | Attend this launch webcast with Scott Hebner, Vice President of IBM Rational Marketing and Strategy, where he will overview Rational’s new offerings and programs to help customers accelerate software innovation on System z. He will discuss how these solutions help organizations extend their core business processes toward modern architectures such as SOA and web technologies to deliver business improvements that stand the test of time. FREE! Go There Now!
| | | | Viper 2 brings a great value to developer communities including SQL, XML, PHP, Ruby, .NET and Java. You probably already know that DB2 Express-C is free for developers to develop, deploy and distribute. Viper 2 provides a variety of means that help move your application from the development stage to deployment more rapidly. This webcast shows how to best utilize the latest tools available for developing DB2 applications. FREE! Go There Now!
| | | | All FREE IBM® developerWorks Tools! | |