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 Code Examples Articles More By aspfree developerWorks - FREE Tools! | Join this webcast, to learn how the Rational Process Library can help with compliance issues, drive process improvement, and assist in service-oriented architecture (SOA) or Agile development. We will take a peek into the Rational Process Library with content around software and systems engineering (including RUP), operations and systems management, program and portfolio management, and asset and SOA governance. FREE! Go There Now!
| | | | Achieving true agility is a never-ending effort. We will showcase how you can become agile incrementally, a few practices at the time.Which practices should any agile team strive to adopt? What additional practices should you consider based on your needs to scale? Adopting practices are however made much easier with the right tool support. What about if your tools adapt to your practices? We will take a look at how the Jazz technology can be leveraged to make your process change the behavior of your tools. FREE! Go There Now!
| | | | Learn to enable users to both rate existing animations and to combine existing animations into new snippets. This is the third in a series of three tutorials that chronicle the building of a site that enables collaborative discussion and animation building using Domino and OpenLaszlo. FREE! Go There Now!
| | | | Visit IBM developerWorks to download the latest trial version of IBM Data Studio V1.1 at no cost. IBM Data Studio is a comprehensive data management solution that helps you effectively design, develop, deploy and manage your data, databases, and database applications throughout the data management life cycle utilizing a consistent and integrated user interface. Unlike other client-side data management solutions that focus on only one aspect of the application lifecycle or database administration, Data Studio complements the Rational Software Delivery platform, providing unparalleled flexibility for a heterogeneous data server environment across platforms. 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!
| | | | Learn how to do more with your reusable assets with the free Rational Asset Manager eKit. The eKit includes demos on how Rational Asset Manager tracks and audits your assets in order to utilize them for reuse. Plus you’ll find white papers and a Webcast that discuss the challenges of a Service Oriented Architecture and how Rational Asset Manager can provide quick and effective solutions. 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!
| | | | Visit IBM developerWorks to try the IBM SOA Sandbox for process. The SOA Sandbox for process focuses on providing a trial environment with the necessary tooling and components required to gain a better understanding of business processes and how to best improve existing business processes to derive value quickly. FREE! Go There Now!
| | | | Whether you are creating new applications or modifying existing ones, managing integration of new components with traditional z/OS elements is a critical part of building and deploying modern applications. Listen to this webcast to see how IBM can help you optimize your development process using an IDE like Rational Developer for System z that integrates with management tools, such as ClearCase to manage your application development on mainframes. FREE! Go There Now!
| | | | The Eclipse community is constantly working to extend Eclipse's functionality. In this webcast, learn about some of the most important and feature-rich projects under development. From multi-language support to plug-in development, tune in to see what Eclipse is capable of now. FREE! Go There Now!
| | | | All FREE IBM® developerWorks Tools! | |