?
Solved

disconnected recordset in JScript?

Posted on 2002-06-21
2
Medium Priority
?
534 Views
Last Modified: 2012-08-13
How do i create disconnected recordset in Javascript?

In VB it's easy:

Set rs.ActiveConnection = Nothing

But how do you do in JS? (and JS only)

these DO NOT work:
rs.ActiveConnection = null;
rs.ActiveConnection = undefined;
rs.ActiveConnection = new Object(null);
rs.ActiveConnection.Close


0
Comment
Question by:chiche
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 20

Accepted Solution

by:
jitganguly earned 800 total points
ID: 7099600
Here it is
<%@Language="JScript"%>
<!-- Include file for JScript ADO Constants -->
<!--#include File="adojavas.inc"-->
<%
     // Connection string.
     var strCon = "Provider=sqloledb;Data Source=myServer;Initial Catalog=Northwind;User Id=myUser;Password=myPassword";
             
     // Create the required ADO objects.
     conn = Server.CreateObject("ADODB.Connection");
     rs = Server.CreateObject("ADODB.recordset");
             
     // Open the connection.
     conn.Open(strCon);
     
     // Retrieve some records.
     var strSQL = "Select * from Shippers";
     rs.CursorLocation = adUseClient;
     rs.Open(strSQL, conn, adOpenStatic, adLockOptimistic);

     // Disconnect the recordset.
     DisconnectRecordset(rs);
     
     // Release the connection.
     conn.Close();

     // Check the status of the connection.
     Response.Write("<BR> Connection.State = " + conn.State);
     
     conn = null;
         
     // Use the diconnected recordset here.
     
     // Release the recordset.
     rs.Close();
     rs = null;
%>

<SCRIPT LANGUAGE="VBScript" RUNAT="SERVER">
Sub DisconnectRecordset(rs)
     Set rs.ActiveConnection = Nothing
End Sub
</SCRIPT>


http://support.microsoft.com/default.aspx?scid=kb;en-us;Q289531
0
 

Author Comment

by:chiche
ID: 7099618
jitganguly , you are not answering my question since I specified "JS only". I already knew this method of mixing VBScript with JSScript.

But I give you the points anyway because you included a link to the Microsoft Web Site which basically proves that there is no other way.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question