mysqldata.cpp 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. // MySqlData.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "mysqldata.h"
  5. #include "AutoRun.h"
  6. #include <math.h>
  7. #ifdef _DEBUG
  8. #define new DEBUG_NEW
  9. #undef THIS_FILE
  10. static char THIS_FILE[] = __FILE__;
  11. #endif
  12. CDatabase *g_curdb=NULL;
  13. /////////////////////////////////////////////////////////////////////////////
  14. /////////////////////////////////////////////////////////////////////////////
  15. IMPLEMENT_DYNAMIC(RstSendReg, CRecordset)
  16. RstSendReg::RstSendReg(CDatabase* pdb)
  17. : CRecordset(pdb)
  18. {
  19. //{{AFX_FIELD_INIT(RstSendReg)
  20. m_account = _T("");
  21. m_phones = _T("");
  22. m_content = _T("");
  23. m_timestamp = _T("");
  24. m_msgcount = _T("");
  25. m_log = _T("");
  26. m_status = _T("");
  27. m_id = _T("");
  28. m_nFields = 8;
  29. //}}AFX_FIELD_INIT
  30. this->m_pDatabase = g_curdb;
  31. m_nDefaultType = forwardOnly;
  32. m_strSort="account desc,timestamp desc,phones desc";
  33. }
  34. CString RstSendReg::GetDefaultConnect()
  35. {
  36. return _T("ODBC;DSN=");
  37. }
  38. CString RstSendReg::GetDefaultSQL()
  39. {
  40. return _T("[sendreg]");
  41. }
  42. void RstSendReg::DoFieldExchange(CFieldExchange* pFX)
  43. {
  44. //{{AFX_FIELD_MAP(RstSendReg)
  45. pFX->SetFieldType(CFieldExchange::outputColumn);
  46. RFX_Text(pFX, _T("[account]"), m_account);
  47. RFX_Text(pFX, _T("[phones]"), m_phones, 102400);
  48. RFX_Text(pFX, _T("[content]"), m_content, 102400);
  49. RFX_Text(pFX, _T("[timestamp]"), m_timestamp);
  50. RFX_Text(pFX, _T("[msgcount]"), m_msgcount);
  51. RFX_Text(pFX, _T("[log]"), m_log);
  52. RFX_Text(pFX, _T("[status]"), m_status);
  53. RFX_Text(pFX, _T("[autoid]"), m_id);
  54. //}}AFX_FIELD_MAP
  55. }
  56. /////////////////////////////////////////////////////////////////////////////
  57. // RstSendReg diagnostics
  58. #ifdef _DEBUG
  59. void RstSendReg::AssertValid() const
  60. {
  61. CRecordset::AssertValid();
  62. }
  63. void RstSendReg::Dump(CDumpContext& dc) const
  64. {
  65. CRecordset::Dump(dc);
  66. }
  67. #endif //_DEBUG