steve - 2014-02-14

I'm trying to make use of Windows Search by using java Jacob library. but I'm having troubles to specify the maxRecords option to limit the number of rows get back.

I'm trying to do it by using this line:

Dispatch.put(connection, "MaxRecords", new Variant(10));

After setting up the connection:

connection = new Dispatch("ADODB.Connection");
Dispatch.call(connection, "Open", "Provider=Search.CollatorDSO;Extended Properties='Application=Windows';");
//error here
Dispatch.put(connection, "MaxRecords", new Variant(10));

What am I doing wrong?
There's no error on compilation but on executing I get this message:

com.jacob.com.ComFailException: A COM exception has been encountered:

At Invoke of: MaxRecords

Description: 80020007 / No named arguments.

...

Internal Server Error (500) - The server encountered an unexpected condition which prevented it from fulfilling the request

And this one when accessing through my restful by URL:

Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request
You can get technical details here.
Please continue your visit at our home page.

Everything works fine without that line.