ISQLite3.h 956 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef __SQLITE3_INTERFACE_20160120__
  2. #define __SQLITE3_INTERFACE_20160120__
  3. #pragma once
  4. #include <string>
  5. #include <vector>
  6. #ifndef _UNICODE
  7. typedef std::string TString;
  8. #else
  9. typedef wstring TString;
  10. #endif
  11. #include "..\\SQLite3\\sqlite3.h"
  12. #pragma comment(lib, "SQLite3.lib")
  13. class ISQLite3
  14. {
  15. public:
  16. ISQLite3(void);
  17. ~ISQLite3(void);
  18. public:
  19. //打开;
  20. int Open(const char* pszpath);
  21. //关闭;
  22. int Close();
  23. //创建表;
  24. int CreateTabel(const char* pSql, CString& strError);
  25. //执行;
  26. int Exec(const char* pSql, CString& strError);
  27. //错误消息;
  28. const char* Get_ErrMsg();
  29. //查询;
  30. int Select(const char* pTableName, const char* pFields, const char* pLimit, std::vector<TString>& vValues, CString& strError);
  31. //插入;
  32. int Insert(const char* pTableName, const char* pFields, const char* pValues, CString& strError);
  33. //删除;
  34. int Delete(const char* pTableName, const char* pLimit, CString& strError);
  35. private:
  36. sqlite3* m_pSQLite3;
  37. };
  38. #endif