Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
950 B

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1998, Microsoft Corp. All rights reserved.
  4. //
  5. // FILE
  6. //
  7. // rowset.cpp
  8. //
  9. // SYNOPSIS
  10. //
  11. // This file defines the class Rowset.
  12. //
  13. // MODIFICATION HISTORY
  14. //
  15. // 02/20/1998 Original version.
  16. // 04/21/1998 Get rid of unnecessary row assignment in moveNext().
  17. //
  18. ///////////////////////////////////////////////////////////////////////////////
  19. #include <ias.h>
  20. #include <rowset.h>
  21. bool Rowset::moveNext()
  22. {
  23. _com_util::CheckError(releaseRow());
  24. DBCOUNTITEM numRows = 0;
  25. HROW* pRow = &row;
  26. HRESULT hr = rowset->GetNextRows(NULL, 0, 1, &numRows, &pRow);
  27. _com_util::CheckError(hr);
  28. return hr == S_OK && numRows == 1;
  29. }
  30. HRESULT Rowset::releaseRow() throw ()
  31. {
  32. if (row != NULL)
  33. {
  34. HRESULT hr = rowset->ReleaseRows(1, &row, NULL, NULL, NULL);
  35. row = NULL;
  36. return hr;
  37. }
  38. return S_OK;
  39. }