Share via


ICertView::SetResultColumnCount 方法 (certview.h)

SetResultColumnCount 方法會指定憑證服務資料庫之自定義檢視結果集的數據行數目上限。

語法

HRESULT SetResultColumnCount(
  [in] LONG cResultColumn
);

參數

[in] cResultColumn

指定結果集中的數據行數目上限。 如果您只想要計算憑證服務資料庫的數據列,或設為下列其中一個常數,此參數可以設定為正數或零。

意義
CV_COLUMN_LOG_DEFAULT
結果集中的數據行數目將會是已解析之要求之憑證服務預設結果集中的數據行數目。 如果要求產生已發行的憑證或失敗的要求,則會解決要求;撤銷的憑證會被視為已解決。
CV_COLUMN_LOG_FAILED_DEFAULT
結果集中的數據行數目將會是憑證服務默認結果集中已失敗要求的數據行數目。
CV_COLUMN_QUEUE_DEFAULT
結果集中的數據行數目將會是憑證服務預設結果集中尚未解析之要求的數據行數目。

傳回值

VB

如果方法成功,方法會傳回S_OK。

如果方法失敗,它會傳回 HRESULT 值,指出錯誤。 如需常見錯誤碼的清單,請參閱 一般 HRESULT 值

備註

呼叫 SetResultColumnCount 方法之前,必須先呼叫 OpenConnection 方法,以建立與憑證服務伺服器的連線。 建立連接之後,這個方法可以呼叫一次,而且只能呼叫一次,以指定結果集中的數據行數目上限。

如果 cResultColumn 參數設定為正數, (不是其中一個預先定義的常數) ,則必須呼叫 SetResultColumn 方法,以指定要包含在結果集中的數據行。 請注意,如果 SetResultColumn 呼叫超過 SetResultColumnCount 所指定的數據行數目,SetResultColumn 就會失敗。

範例

HRESULT    hr;
// Specify the result set for logged requests.
// pCertView is pointer to ICertView (which has an Open Connection)
hr = pCertView->SetResultColumnCount(CV_COLUMN_LOG_DEFAULT);
if (S_OK != hr)
    printf("Failed ICertView::SetResultColumnCount - %x\n", hr);
else
{
    // Retrieve data rows by means of ICertView::OpenView.
    // ...
}

規格需求

需求
最低支援的用戶端 都不支援
最低支援的伺服器 Windows Server 2003 [僅限傳統型應用程式]
目標平台 Windows
標頭 certview.h (包含 Certsrv.h)
程式庫 Certidl.lib
Dll Certadm.dll

另請參閱

ICertView

ICertView2

ICertView::OpenConnection

ICertView::SetRestriction

ICertView::SetResultColumn