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! | You'll get answers to many questions and more from David Barnes, Lead Evangelist for IBM Emerging Internet Technologies. David will discuss aspects of Web 2.0 that bring value to corporations, academia, and government. He'll also discuss IBM's vision around Web 2.0, including the importance of remixability and consumability. The discussion will culminate with examples of various IBM Software Group solutions you can use to get ahead of the Web 2.0 adoption curve. FREE! Go There Now!
| | | | Hear how IBM Rational Project and Portfolio Management integrated solutions help teams put the right tools and processes in place to maximize the effectiveness and efficiency of project teams and ensure that the business vision is being executed correctly. Learn how to automate and integrate requirements prioritization, top-down project planning, communications and controls, and methodology deployment to keep your scope, costs, and schedules under control. Tackle with an end-to-end approach the management of scope and scope changes, usage of methodology to control and empower project teams, and optimization of resources to align activity costs with the overall project plan. FREE! Go There Now!
| | | | Build secure Web services with transport-level security using IBM Rational Application Developer V7 and IBM WebSphere Application Server V6.1. Follow this three-part series for step-by-step instructions about how to develop Web services and clients, configure HTTP basic authentication, and configure HTTP over SSL (HTTPS). This first part of the series walks you through building a Web service for a simple calculator application. You generate and test two different types of Web services clients: a Java Platform, Enterprise Edition (Java EE) client and a stand-alone Java client. You also handle user-defined exceptions in Web services. FREE! Go There Now!
| | | | Join us for this on demand webcast to learn about developing complex systems more quickly and efficiently. We'll cover market drivers for developing, governing and reusing systems software assets and how you can develop system software assets with Rational Asset Manager. FREE! Go There Now!
| | | | Download a free trial version of IBM Rational Software Analyzer Developer Edition V7.0 to identify bug defects earlier in the software development cycle. Rational Software Analyzer is an extensible software development solution that reduces the expense of bug-fixes by enabling static analysis code reviews and bug identification very early in the development cycle. FREE! Go There Now!
| | | | In this tutorial, you can learn how to install and configure the IBM Rational Asset Manager Eclipse client, explore the different views in the Asset Management perspective, learn various search techniques, work with existing assets, and submit a new asset. FREE! Go There Now!
| | | | Regression testing -- in which code is thoroughly tested to ensure that changes have not produced unexpected results -- is an important part of any development process. But many testing environments neglect the terminal-based applications that still form the backbone of many industries. In this tutorial, you'll learn how the Rational Functional Tester Extension for Terminal-Based Applications works with other Rational Functional Tester to help test terminal-based applications quickly and easily. FREE! Go There Now!
| | | | Visit IBM developerWorks to try the IBM SOA Sandbox for people. The SOA Sandbox for people provides a trial environment with the necessary tooling and components required to enable consistent human and process interaction and collaboration, showing how you can improve user experience and business productivity. FREE! Go There Now!
| | | | Join this webcast to learn how IBM Rational's Functional Testing solution enables you to implement automation your way, at your pace, with your existing staff. In this webcast, you’ll learn how you can eliminate redundancy of manual test scripts, reduce errors, and increase test coverage through test automation. After this presentation you will understand how IBM Rational Functional Testing solution can streamline your manual testing and make test automation easily attainable. FREE! Go There Now!
| | | | With IBM Rational Systems Development Solution, you can deliver products faster with higher quality. Within this kit, Read the “Model Driven Systems Development” white paper to see how to improve product quality and communication. Then check out the rest of the e-Kit to learn more about important topics that can affect the success of any software project through customer examples, tutorials, informative Webcasts, and best practices for designing, building and managing systems. From start to finish, at every stage in your projects, Rational Systems Development Solution can help your company reach its full potential. FREE! Go There Now!
| | | | All FREE IBM® developerWorks Tools! | |