Microsoft KB Archive/290796

= PRB: Error Message &quot;Unspecified Error&quot; When Filtering on the 501st Column in an ADO Recordset =

Article ID: 290796

Article Last Modified on 6/25/2004

-

APPLIES TO


 * Microsoft ActiveX Data Objects 2.6
 * Microsoft ActiveX Data Objects 2.7
 * Microsoft Visual Basic 6.0 Enterprise Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition Service Pack 3
 * Microsoft Visual Basic 6.0 Enterprise Edition Service Pack 4
 * Microsoft Visual Basic 6.0 Enterprise Edition Service Pack 5

-



This article was previously published under Q290796



SYMPTOMS
When you use ActiveX Data Objects (ADO) to set a filter on the 501st column in an ADO recordset, you receive the following error message:

Run-Time Error -2147467259(80004005) Unspecified Error



Steps to Reproduce Behavior
 In Visual Basic, open a new Standard EXE project. Form1 is added to the project by default. On the Project menu, click to select References. From the list of available references, select Microsoft ActiveX Data Objects 2.x Library. Add a CommandButton to Form1.  Paste the following code into the Click event of Command1: Dim ors As New ADODB.Recordset Dim x As Long, i As Long

' Create a Recordset with 1000 columns For x = 1 To 1000 ors.Fields.Append &quot;f&quot; & x, adInteger, 0, adFldIsNullable Or adFldUpdatable Next ors.Open

' Add 10 records to it For x = 1 To 10 ors.AddNew For i = 0 To ors.Fields.Count - 1 ors.Fields(i).Value = 100 Next ors.Update Next ors.MoveFirst

' Set a filter For x = 1 To 1000 'Next line will fail when x is >= 502 ors.Filter = &quot;f&quot; & x & &quot; > 250&quot; ors.Filter = adFilterNone Next  Run the project, and note that the error message occurs when x is equal to or greater than 502.

Keywords: kbprb KB290796

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.