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 translations Article translations
Article ID: 914535 - View products that this article applies to.
Expand all | Collapse all

On This Page

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.

RESOLUTION

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 "Applies to" section. This problem was first corrected in Microsoft SQL Server 2005 Service Pack 1.

REFERENCES

For more information about the ADO Recordset object, visit the following Microsoft Developer Network (MSDN) Web site:
http://msdn2.microsoft.com/en-us/library/ms808775.aspx
For more information about the type of cursor that is used in a Recordset object, visit the following MSDN Web site:
http://msdn2.microsoft.com/en-us/library/ms806220.aspx
For more information about the location of the cursor service, visit the following MSDN Web site:
http://msdn2.microsoft.com/en-us/library/ms806218.aspx

Properties

Article ID: 914535 - Last Review: November 22, 2007 - Revision: 2.5
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
Keywords: 
kbsql2005sp1fix kbsql2005webdata kbbug kbsql2005presp1fix kbsql2005repl kbexpertiseadvanced kbtshoot KB914535

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com