共用方式為


How to: Use Data-at-Execution Parameters (ODBC)

新增: 2006 年 4 月 14 日

To use data-at-execution text, ntext, or image parameters

  1. When calling SQLBindParameter to bind a program buffer to the statement parameter:

    • For the last parameter, use SQL_LEN_DATA_AT_EXEC(length) where length is the total length of the text, ntext, or image parameter data in bytes.
    • Use an rgbValue (eighth parameter) of a program-defined parameter identifier.
  2. Calling SQLExecDirect or SQLExecute returns SQL_NEED_DATA, which indicates that data-at-execution parameters are ready for processing.

  3. For each data-at-execution parameter:

    • Call SQLParamData to get the program-defined parameter ID. It will return SQL_NEED_DATA if there is another data-at-execution parameter.
    • Call SQLPutData one or more times, to send the parameter data, until length is sent.
  4. Call SQLParamData to indicate that all the data for the final data-at-execution parameter is sent. It will not return SQL_NEED_DATA.

請參閱

其他資源

Managing text and image Columns (ODBC)

說明及資訊

取得 SQL Server 2005 協助