BUG: MDAC 1.5 to MDAC 2.0 Error 80004005 Unexpected Error

ID: Q225042


The information in this article applies to:
  • Microsoft Data Access Components versions 2.0, 2.1


SYMPTOMS

Within your MDAC 2.0 or MDAC 2.1 code, you have multiple recordsets with the same recordset object that are created off of the same command and are also pointing to the same connection. The first recordset that is opened contains multiple recordsets within that same object. Before calling NextRecordset on that object, open another Recordset (new recordset object) and point the ActiveConnection property to the same command and connection to which at the other recordset object was pointing. This causes the following error when the Set rs = rs.NextRecordset is executed:

error '80004005' Unspecified error
This error occurs in MDAC 2.0 and MDAC 2.1 and does not occur in MDAC 1.5.


RESOLUTION

Make sure that the ActiveConnection property of the Command object for the first recordset is set only once throughout the page (especially if it contains multiple physical recordsets within the same recordset object) if the same connection is still being used.


STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.


MORE INFORMATION

Steps to Reproduce Behavior

  1. Open a new Active Server Pages (ASP) page in Visual InterDev and paste the following code onto the page:


  2. 
    <%@ Language=VBScript %>
    <%
            Set cn = Server.CreateObject("ADODB.Connection")
    	cn.Open "pubs","sa",""
    	Set cmd = Server.CreateObject("ADODB.Command")
    	Set rs = Server.CreateObject("ADODB.Recordset")	
    	cmd.CommandText = "Select * From Authors Select * From Stores Select * From Sales"
    	cmd.CommandType = 1
    	Set cmd.ActiveConnection = cn
            rs.Open cmd
    	Response.Write(rs(0) & "<BR>")
    	
    	GetDBValues	
    
            Response.Write(rs(0) & "<BR>")
            Response.Write(rs(1) & "<BR>")
        
            Set rs = rs.NextRecordset 'Fails on this line
       
            Response.Write("New Recordset after NextRecordset Call" & "<BR>")
            Response.Write(rs(0) & "<BR>")
            Response.Write(rs(1) & "<BR>")
    	
      Sub GetDBValues
    	
    	Set rst = Server.CreateObject("ADODB.Recordset")
    	cmd.CommandText = "Select * from stores" 
    	cmd.CommandType = 1
    	Set cmd.ActiveConnection = cn
    
    	rst.Open cmd
    	Response.Write("Opened new recordset" & "<BR>")
      End Sub		
      %> 
     
  3. Create a data source name (DSN) called "pubs" that points to the pubs database on SQL Server.


  4. Run the page and the following error appears:


  5. '80004005' "Unspecified error"

Additional query words:

Keywords : kbMDAC kbDSupport kbMDAC200bug
Version : WINDOWS:2.0,2.1
Platform : WINDOWS
Issue type : kbbug


Last Reviewed: December 9, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.