[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

disconnected recordset in JScript?

Posted on 2002-06-21
2
Medium Priority
?
541 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

650 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