SQLite3Interface.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /************************************************************************/
  2. /*
  3. 文件名称: SQLite3Interface.h
  4. 文件标识:
  5. 内容摘要: SQLite3 封装类;
  6. 其它说明: 无
  7. 当前版本: V 0.1
  8. 作 者: Jeff
  9. 完成日期: 2015年04月06日
  10. 修改记录1:
  11. 修改日期:-
  12. 版 本 号:-
  13. 修 改 人:-
  14. 修改内容:-
  15. */
  16. /************************************************************************/
  17. #ifndef __SQLITE3_INTERFACE__
  18. #define __SQLITE3_INTERFACE__
  19. // #include "sqlite3.h"
  20. // #pragma comment(lib,"SQLite3.lib")
  21. #include "CharacterConvert.h"
  22. //////////////////////////////////////////////////////////////////////////
  23. // 创建表,注意:SQLite3每条SQL语句结束时需要加上分号;
  24. #define CREATE_DB_TBL_ _T("create table remoteinfo(\
  25. inuse int not null,\
  26. branch text not null,\
  27. ip text not null,\
  28. domain text not null, \
  29. host text null,\
  30. sharedirectory text null,\
  31. delaftertakeway int defualt(0),\
  32. deldays int null,\
  33. primary key(domain));")
  34. //////////////////////////////////////////////////////////////////////////
  35. typedef struct _STRemoteInfo_
  36. {
  37. int bInUse;
  38. // 店铺信息;
  39. TCHAR szBranch[MAX_PATH];
  40. TCHAR szIP[MAX_PATH];
  41. TCHAR szDoMain[MAX_PATH];
  42. // 共享信息;
  43. TCHAR szHost[MAX_PATH]; // 异地客户端所共享的选片机器;
  44. TCHAR szShareDirectory[MAX_PATH]; // 异地客户端所共享的选片机器目录;
  45. bool bDelAfterTakeWay; // 是否在取件完成后自动删除,如果否则读取dwDelDays;
  46. DWORD dwDelDays; // 选片OK后多少天自动删除;
  47. }STRemoteInfo,*pSTRemoteInfo;
  48. #pragma once
  49. class CSQLite3Interface
  50. {
  51. public:
  52. CSQLite3Interface();
  53. ~CSQLite3Interface();
  54. sqlite3 *m_pdb;
  55. bool m_bOpen;
  56. int excute(const TCHAR* pszexcu);
  57. int opendb(const TCHAR *pszdb);
  58. int closedb();
  59. int creattbl(const TCHAR *pszcreate);
  60. int isnerttbl(const TCHAR* pszInsert);
  61. int gettbl_remoteinfo(const TCHAR* pszSelect,vector<STRemoteInfo> &vtRemoteInfo);
  62. int removetbl(const TCHAR* pszdel);
  63. };
  64. #endif