Query.Execute in Query.java

Note

Indexing Service is no longer supported as of Windows XP and is unavailable for use as of Windows 8. Instead, use Windows Search for client side search and Microsoft Search Server Express for server side search.

 

This code segment defines the Execute method of the Query class.

    void Execute()
    {
        m_RS = new Recordset();
        m_RS.Open( m_SqlText,
                   "provider=MSIDXS",
                   AdoEnums.CursorType.STATIC,
                   AdoEnums.LockType.BATCHOPTIMISTIC,
                   AdoEnums.CommandType.TEXT );
    }

The first executable line of the method creates a new ADO Recordset object, m_RS. The next line executes the query in the m_SqlText member with the Open method of the m_RS Recordset object. The first parameter of the Open method is the text of the SQL query. The second parameter sets the data provider to Indexing Service. The subsequent parameters, which are ADO enumerated constants, define the properties of the query.