Microsoft KB Archive/914535

= FIX: When you use an ActiveX Data Objects Recordset object to access a database in SQL Server 2005, the Recordset object returns no records =

Article ID: 914535

Article Last Modified on 11/22/2007

-

APPLIES TO


 * Microsoft SQL Server 2005 Standard Edition
 * Microsoft SQL Server 2005 Workgroup Edition
 * Microsoft SQL Server 2005 Developer Edition
 * Microsoft SQL Server 2005 Enterprise Edition

-





SYMPTOMS
Consider the following scenario:
 * You use a Microsoft ActiveX Data Objects (ADO) Recordset object to access a database in Microsoft SQL Server 2005.
 * The query of the Recordset object is connected to a pair of tables by using a left outer join.
 * You set the CursorType property for the Recordset object to adOpenKeyset.

In this scenario, the Recordset object returns no records.

Note This problem does not occur when you try to access a database in Microsoft SQL Server 2000.



Service pack information
To resolve this problem, obtain the latest service pack for Microsoft SQL Server 2005. For more information, click the following article number to view the article in the Microsoft Knowledge Base:

913089 How to obtain the latest service pack for SQL Server 2005



WORKAROUND
To work around this problem, use one of the following methods:
 * Change the CursorType property for the Recordset object to one of the following settings:
 * adOpenDynamic
 * adOpenForwardOnly
 * adOpenStatic
 * Change the CursorLocation property for the Recordset object to adUseClient.
 * When the query of the Recordset object is connected to a pair of tables by using a left outer join, add a primary key to each of these tables in SQL Server 2005.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the &quot;Applies to&quot; section. This problem was first corrected in Microsoft SQL Server 2005 Service Pack 1.

