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! | This demonstration gives you an overview of IBM® Rational® Build Forge Express Edition, a global offering that provides a framework to automate and execute software processes. Rational Build Forge provides a software assembly line that can support all of your tools, technologies, and platforms so you can achieve a repeatable, reliable, and traceable build and release process. FREE! Go There Now!
| | | | The IBM DB2 Deep Compression ROI tool is designed for DBA’s and IT management personnel to perform a clinical analysis of the cost savings gained from the Storage Optimization feature of DB2 9 for Linux, UNIX and Windows. The feature, also known as Deep Compression, compresses data that lies within a database by up to 80% at times. FREE! Go There Now!
| | | | This whitepaper presents the benefits of successfully introducing static analysis into your organization using IBM Rational Software Analyzer. Additionally, it identifies some common pitfalls that can hinder the effective use of static analysis tooling as well as presents 10 simple strategies designed to help you quickly realize the value of static analysis using Rational Software Analyzer. FREE! Go There Now!
| | | | Rational Modeling Extension for Microsoft .NET enhances usability for code generation supporting a more intelligent refactoring. The latest enhancements enable organizations with Java and .NET systems and software development maintain architectural integrity across heterogeneous platforms. FREE! Go There Now!
| | | | Join this Rational Talks to You teleconference on November 29 at 1:00 pm ET to participate in an interactive discusssion with Grady Booch around architecture and reuse. Get your questions answered! FREE! Go There Now!
| | | | Get a free trial download of IBM Lotus Forms V3.0 (formerly Workplace Forms), which provides a zero-footprint eForms solution to help you automate and move forms-based business processes off the desktop and onto the Web. With Lotus Forms, you can extend applications beyond the firewall by creating a single electronic form document ready for use in both thick and Web 2.0 thin client format. 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!
| | | | As businesses grow increasingly dependent upon Web applications, these complex entities grow more difficult to secure. Most companies equip their Web sites with firewalls, Secure Sockets Layer (SSL), and network and host security, but the majority of attacks are on applications themselves – and these technologies cannot prevent them. This paper explains what you can do to help protect your organization, and it discusses an approach for improving your organization’s Web application security. FREE! Go There Now!
| | | | In this webcast, IBM Rational will discuss the importance of Web application security and will share techniques and best practices to introduce application security testing into current QA processes including: understanding common security vulnerabilities and techniques to integrate security testing with defect tracking and remediation systems in an effort to safeguard sensitive online information. FREE! Go There Now!
| | | | Explore how Rational and WebSphere software enable enterprise documentation in SOA environments. Specifically, a new integration between IBM WebSphere® Business Modeler and IBM Rational® Method Composer software can help technical writers more easily keep enterprise operations manuals in sync with changes that are made to business processes, resulting in more accurate and timely documentation that benefits the entire enterprise. FREE! Go There Now!
| | | | All FREE IBM® developerWorks Tools! | |
| | | | | | | |  | | | |