Microsoft Knowledge Base Email Alertz

When you are using the

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 251267 - Last Review: September 26, 2005 - Revision: 4.4

FIX: Access Violation in Msadce.dll When Using the RDS Data Control

This article was previously published under Q251267

On This Page

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:
http://msdn.microsoft.com/en-us/data/aa937729.aspx (http://msdn.microsoft.com/en-us/data/aa937729.aspx)

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.

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
Keywords: 
kbhotfixserver kbqfe kbbug kbfix kbmdac250fix kbmdac260fix kbmdac270fix kbqfe KB251267
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate