I am using below statement to query the windows search and getting the above error and following error IErrorInfo.GetDescription failed with E_FAIL(0x80004005)
.
var query = "SELECT System.ItemName FROM servername.SystemIndex " +
"WHERE SCOPE='file://servername/temp/DanB/Newsletter'
and contains('" + txtSearch.Text + "')";
(I haven't mention the servername above, but I am using the correct server name)
I did search about this error and seems it may occur due to usage of reserved words and symbols. I have gone through Access 2007 reserved words and symbols, and seems the this statement is fine.
Even though, I suspect temp may causing any trouble so I tried [temp] but its same result.
Also I check the value coming from the text box as well.
So I tried coping the file to local drive and it worked.
var query = "SELECT System.ItemName FROM SystemIndex " +
"WHERE SCOPE='file:C:/Users/temp/DanB/Newsletter'
and contains('" + txtSearch.Text + "')";
I have gone thought the FROM Clause regarding the windows search and the syntax (querying network drive) looks fine to me.
Any idea what is causing this issue?