Leaked source code of windows server 2003
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.

87 lines
3.5 KiB

  1. // ReportDailyBuckets.h : Declaration of the CReportCountDaily
  2. /*************************************************************************************
  3. * module: ReportDailyBuckets.h - OLEDB Template
  4. *
  5. * author: Tim Ragain
  6. * date: Jan 2, 2002
  7. *
  8. * Purpose: To get the sBucket, gBucket & StopCode information from the database
  9. * for a specific date by calling the ReportDailyBuckets stored procedure.
  10. *
  11. *************************************************************************************/
  12. #pragma once
  13. #include "Settings.h"
  14. [
  15. #if(lDatabase == 0)
  16. db_source(L"Provider=SQLOLEDB.1;Persist Security Info=False;Pwd=ocarp;User ID=ocarp;Initial Catalog=KaCustomer2;Data Source=OCATOOLSDB"),
  17. #elif(lDatabase == 1)
  18. db_source(L"Provider=SQLOLEDB.1;Persist Security Info=False;Pwd=Tim5;User ID=Tim5;Initial Catalog=KaCustomer;Data Source=TIMRAGAIN04\\TIMRAGAIN04"),
  19. #elif(lDatabase == 2)
  20. db_source(L"Provider=SQLOLEDB.1;Persist Security Info=False;Pwd=Tim5;User ID=Tim5;Initial Catalog=KaCustomer;Data Source=TIMRAGAIN05"),
  21. #elif(lDatabase == 3)
  22. db_source(L"Provider=SQLOLEDB.1;Persist Security Info=False;Pwd=Tim5;User ID=Tim5;Initial Catalog=KaCustomer;Data Source=Homebase"),
  23. #elif(lDatabase == 4)
  24. db_source(L"Provider=SQLOLEDB.1;Persist Security Info=False;Pwd=ocarpts@2;User ID=ocarpts;Initial Catalog=KaCustomer2;Data Source=tkwucdsqla02"),
  25. #endif
  26. db_command(L"{ ? = CALL dbo.ReportDailyBuckets(?) }")
  27. ]
  28. class CReportDailyBuckets
  29. {
  30. public:
  31. // In order to fix several issues with some providers, the code below may bind
  32. // columns in a different order than reported by the provider
  33. //[ db_column(1, status=m_dwIncidentIDStatus, length=m_dwIncidentIDLength) ] LONG m_IncidentID;
  34. //[ db_column(2, status=m_dwCreatedStatus, length=m_dwCreatedLength) ] DBTIMESTAMP m_Created;
  35. [ db_column(1, status=m_dwSbucketStatus, length=m_dwSbucketLength) ] LONG m_Sbucket;
  36. [ db_column(2, status=m_dwGbucketStatus, length=m_dwGbucketLength) ] LONG m_Gbucket;
  37. [ db_column(3, status=m_dwStopCodeStatus, length=m_dwStopCodeLength) ] LONG m_StopCode;
  38. // The following wizard-generated data members contain status
  39. // values for the corresponding fields. You
  40. // can use these values to hold NULL values that the database
  41. // returns or to hold error information when the compiler returns
  42. // errors. See Field Status Data Members in Wizard-Generated
  43. // Accessors in the Visual C++ documentation for more information
  44. // on using these fields.
  45. // NOTE: You must initialize these fields before setting/inserting data!
  46. DBSTATUS m_dwSbucketStatus;
  47. DBSTATUS m_dwGbucketStatus;
  48. DBSTATUS m_dwStopCodeStatus;
  49. //DBSTATUS m_dwCreatedStatus;
  50. // The following wizard-generated data members contain length
  51. // values for the corresponding fields.
  52. // NOTE: For variable-length columns, you must initialize these
  53. // fields before setting/inserting data!
  54. DBLENGTH m_dwSbucketLength;
  55. DBLENGTH m_dwGbucketLength;
  56. DBLENGTH m_dwStopCodeLength;
  57. //DBLENGTH m_dwCreatedLength;
  58. [ db_param(1, DBPARAMIO_OUTPUT) ] LONG m_RETURN_VALUE;
  59. [ db_param(2, DBPARAMIO_INPUT) ] DBTIMESTAMP m_ReportDate;
  60. /*[ db_accessor(0, TRUE) ];
  61. [ db_column(1) ] LONG m_Sbucket;
  62. [ db_column(2) ] LONG m_Gbucket;
  63. [ db_column(4) ] LONG m_StopCode;*/
  64. void GetRowsetProperties(CDBPropSet* pPropSet)
  65. {
  66. VARIANT vCT;
  67. vCT.lVal = 600;
  68. pPropSet->AddProperty(DBPROP_CANFETCHBACKWARDS, true, DBPROPOPTIONS_OPTIONAL);
  69. pPropSet->AddProperty(DBPROP_CANSCROLLBACKWARDS, true, DBPROPOPTIONS_OPTIONAL);
  70. pPropSet->AddProperty(DBPROP_COMMANDTIMEOUT, vCT);
  71. }
  72. };