Microsoft KB Archive/251267: Difference between revisions

From BetaArchive Wiki
(importing KB archive)
 
m (Text replacement - """ to """)
 
(2 intermediate revisions by the same user not shown)
Line 87: Line 87:


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


</div>
</div>

Latest revision as of 13:51, 21 July 2020

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