0

I am using the Windows Search API from C# with the following query:

SELECT  System.ItemNameDisplay,SYSTEM.ITEMURL,System.DateModified, System.ItemName, System.Search.Rank, System.Keywords, System.Search.AutoSummary,System.Search.GatherTime, System.ItemType FROM "SYSTEMINDEX" WHERE CONTAINS(*,'"cowie*"',1033) Order By System.DateModified Desc

This command is supplied to an OleDbCommand object, which is read in a loop:

 while (reader.Read())                 
            {...}

When the command runs, an unspecified error is produced at the Reader.Read() statement after processing the last result. If the search string does not exist in the Windows search index, the error is thrown with no results returned.

Whilst the error can be trapped by its "Unspecified Error" message and not presented to the user as an error (as all results seem to be returned before it occurs), it would be better to prevent it from occurring at all. Can anyone offer any guidance on how to do this?

SimonKravis
  • 553
  • 1
  • 3
  • 24

1 Answers1

0

I got the same error as yours although in VB6 on a Windows Server 2012. Long story short: I'm executing a windows search query and while reading the results from a record set, I get:

Unspecified error

I found out that after removing the windows updates KB4022717, KB4022726 the error no longer occurs.

Check this out.

Alex M
  • 2,756
  • 7
  • 29
  • 35