Microsoft KB Archive/251267

From BetaArchive Wiki
< Microsoft KB Archive
Revision as of 13:51, 21 July 2020 by X010 (talk | contribs) (Text replacement - """ to """)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Article ID: 251267

Article Last Modified on 9/26/2005



APPLIES TO

  • Microsoft Data Access Components 1.5
  • Microsoft Data Access Components 2.0
  • Microsoft Data Access Components 2.1 Service Pack 2
  • Microsoft Data Access Components 2.1
  • Microsoft Data Access Components 2.1 Service Pack 2
  • Microsoft Data Access Components 2.1 Service Pack 1



This article was previously published under Q251267

SYMPTOMS

When you are using the RDS Data control, an Access Violation may occur in the Msadce.dll file. This may occur after you have sorted the recordset of the control more than one time, and then closed the client in which the control is hosted, such as Microsoft Internet Explorer or a Visual Basic client.

CAUSE

A reference counting problem in Microsoft Data Access Components (MDAC) Remote Data Services Data Control (Msadco.dll) permits objects to be prematurely unloaded. The memory where the objects are loaded is being accessed by the cursor engine (Msadce.dll) during the cleanup process that happens during shutdown, which generates an Access Violation.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

This problem is fixed in Microsoft Data Access Components (MDAC) version 2.5 or later. The latest version of MDAC can be obtained from the following Microsoft Web site:

MORE INFORMATION

The English version of this hotfix has the file attributes (or later) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.

   Date      Version       Size            File name    
   ----------------------------------------------------
   3/17/00   2.12.5117.0   134,928 bytes   msadco.dll
                

Steps to Reproduce the Behavior

Paste the following code into a new Web page and save the page in the root directory for a Web site. Modify the connection string and query in the Init() subroutine to values that work at the installation site of the page. Make sure that the User ID has the appropriate permissions to perform this operation on the database.

<HTML>
<HEAD>
<TITLE>Microsoft Knowledge Base Sample Code:  Q251267</TITLE>
<SCRIPT LANGUAGE="VBScript">
    Sub Init()
        ' Load a sorted recordset into the Data Control...
        rs.CursorLocation = 3
        rs.Open "SELECT au_fname FROM authors", "Provider=SQLOLEDB.1;Data Source=MyServer;
                  Initial Catalog=pubs;UID=<username>;pwd=<strong password>;"
        rs.Sort = "au_fname"
        Set dc.SourceRecordset = rs
    End Sub
    
    Sub Button1_OnClick()
        ' Clear the Data Control's recordset property...
        Set dc.SourceRecordset = Nothing
        ' Unhide second button and hide first one...
        Button2.style.display = "inline"
        Button1.style.display = "none"
    End Sub
    
    Sub Button2_OnClick()
        ' Assign the existing recordset back to the Data Control...
        Set dc.SourceRecordset = rs
        ' Hide second button and inform user that IE will now crash...
        Button2.style.display = "none"
        Span1.innerHTML = "If your MDAC version is earlier than 
                2.5, IE will crash when you navigate away from this page 
                or close the browser. "
    End Sub
</SCRIPT>
<HEAD>
<BODY OnLoad="Init">
<OBJECT ID="rs" CLASSID="clsid:00000535-0000-0010-8000-00AA006D2EA4" HEIGHT=0 WIDTH=0></OBJECT>
<OBJECT ID="dc" CLASSID="clsid:bd96c556-65a3-11d0-983a-00c04fc29e33" HEIGHT=0 WIDTH=0></OBJECT>
<INPUT TYPE="BUTTON" ID="Button1" VALUE="Empty Data Control">
<INPUT TYPE="BUTTON" ID="Button2" VALUE="Reload Data Control" STYLE="{display:none;}"> 
<B><SPAN ID=Span1></SPAN> 
<TABLE ID=Table1 DATASRC="#dc" >
    <TR><TD><SPAN DATAFLD="au_fname"></SPAN></TD></TR>
</TABLE>
</BODY>
</HTML>
                

Load the page in Internet Explorer on a computer with any version of MDAC prior to 2.5. Follow the instructions as you are prompted. You may be warned that the page is accessing data on another domain. This is expected. The page causes your browser to crash with the Access Violation described in the "Symptoms" section of this article.

Keywords: kbbug kbfix kbmdac270fix kbmdac250fix kbqfe kbmdac260fix kbhotfixserver KB251267