// NumRowsFetched. SQLSetStmtAttr(hstmt, SQL_ATTR_ROW_BIND_TYPE, sizeof(ORDERINFO), 0); SQLSetStmtAttr(hstmt, SQL_ATTR_ROW_ARRAY_SIZE, ROW_ARRAY_SIZE, 0); SQLSetStmtAttr(hstmt, SQL_ATTR_ROW_STATUS_PTR, RowStatusArray, 0); SQLSetStmtAttr(hstmt, SQL_ATTR_ROWS_FETCHED_PTR, &NumRowsFetched, 0); // Bind elements of the first structure in the array to the OrderID, // SalesPerson, and Status columns. SQLBindCol(hstmt, 1, SQL_C_ULONG, &OrderInfoArray[0].OrderID, 0, &OrderInfoArray[0].OrderIDInd); SQLBindCol(hstmt, 2, SQL_C_CHAR, OrderInfoArray[0].SalesPerson, sizeof(OrderInfoArray[0].SalesPerson), &OrderInfoArray[0].SalesPersonLenOrInd); SQLBindCol(hstmt, 3, SQL_C_CHAR, OrderInfoArray[0].Status, sizeof(OrderInfoArray[0].Status), &OrderInfoArray[0].StatusLenOrInd); // Execute a statement to retrieve rows from the Orders table. SQLExecDirect(hstmt, "SELECT OrderID, SalesPerson, Status FROM Orders", SQL_NTS); // Fetch up to the rowset size number of rows at a time. Print the actual // number of rows fetched; this number is returned in NumRowsFetched. // Check the row status array to print only those rows successfully // fetched. Code to check if rc equals SQL_SUCCESS_WITH_INFO or // SQL_ERRORnot shown. while ((rc = SQLFetchScroll(hstmt,SQL_FETCH_NEXT,0)) != SQL_NO_DATA) {
asdsa