Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Querying the SharePoint information store using ADO

  Asked By: Isabel    Date: Jan 08    Category: Sharepoint    Views: 1613

I am trying to execute the following query against the SharePoint
information store:

select "DAV:getlastmodified","DAV:href"
from SCOPE('deep traversal of "http://dev/workspace1/documents"')
where ("DAV:getlastmodified" > CAST("2002-10-22T21:09:51.000Z"
as "dateTime.tz")

I get an error "-2147217900 (80040e14)". It works fine if I do a
shallow traversal. It appears that you cannot specify search
criteria on "DAV:getlastmodified" if you're doing a deep traversal,
but I don't understand why and can't find any documentation to
explain it. All the items being queried have that property. If
anyone can explain to me why I cannot do this query or what is wrong
with it.



7 Answers Found

Answer #1    Answered By: Alka Sarabhai     Answered On: Jan 08

How many documents do you have in your store? I know that when I
tried a deep  traversal on my store  from the root, the query  kept on
timing out.

Answer #2    Answered By: Eashan Nadkarni     Answered On: Jan 08

There are approximately 2600 documents (850MB) in the store. I don't
think it's timing out though. When I execute  the query, it get the
error right away.

Answer #3    Answered By: William Odom     Answered On: Jan 08

Can you try removing the cast and date, replacing it with a call to

Answer #4    Answered By: Mia Scott     Answered On: Jan 08

Unfortunately, adding something like (DATEADD(year,
-1, GETGMTDATE())) to the WHERE clause produces the
same results.

Answer #5    Answered By: Kristian Chaney     Answered On: Jan 08


where ("DAV:getlastmodified" > DATEADD("YEAR", -1,,GETDATE()

I think that YEAR needs quotes.

I have a getlastmod in some old code and it worked back then and it uses
deep  scope. If adding quotes does not work then let me know and I will
dig up that code and run it to get the actual where clause. If I
remember correctly, I could not get this to work without using a DATEADD

Answer #6    Answered By: Alicia Scott     Answered On: Jan 08

The following query  works:

select "DAV:getlastmodified","DAV:href"
from SCOPE('deep traversal of
WHERE ("DAV:getlastmodified" >

Answer #7    Answered By: Mike Lamb     Answered On: Jan 08

Great. There is a little blurb in the SDK about GETGMTDATE and DATE
add. It does not specifically state you MUST use these when working with
dates, but I have yet to see a working example where you supply a date
literal. Also, I believe it depends on which search engine that you use,
Full text or WSS. I believe that GETGMTDATE and DATEADD only works  when
using the MSSeach engine. Anyone else has clarification, I would be

Didn't find what you were looking for? Find more on Querying the SharePoint information store using ADO Or get search suggestion and latest updates.