DataBaseOpt.h 608 B

1234567891011121314151617181920212223242526272829
  1. #ifndef __DATABASEOPT_H__
  2. #define __DATABASEOPT_H__
  3. #include <vector>
  4. #include <afxdb.h>
  5. #include "Lock.h"
  6. class DataBaseOpt
  7. {
  8. public:
  9. DataBaseOpt();
  10. ~DataBaseOpt();
  11. int OpenDB(LPCTSTR lpConnect);
  12. void CloseDB();
  13. BOOL IsOpenDB();
  14. DWORD SelectCount(IN LPCTSTR lpTabName, IN LPCTSTR lpFilter = NULL);
  15. int Select(OUT CArray<CStringArray,CStringArray>& AryOfValues, IN LPCTSTR lpTabName, IN std::vector<CString>& vFields, IN LPCTSTR lpFilter = NULL);
  16. int Execute(IN LPCTSTR lpSQL);
  17. private:
  18. BOOL m_bOpen;
  19. TCHAR m_szConnect[MAX_PATH];
  20. CDatabase* m_pdb;
  21. CLock m_lock;
  22. };
  23. #endif