12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- /************************************************************************/
- /*
- 文件名称: SQLite3Interface.h
- 文件标识:
- 内容摘要: SQLite3 封装类;
- 其它说明: 无
- 当前版本: V 0.1
- 作 者: Jeff
- 完成日期: 2015年04月06日
-
- 修改记录1:
- 修改日期:-
- 版 本 号:-
- 修 改 人:-
- 修改内容:-
- */
- /************************************************************************/
- #ifndef __SQLITE3_INTERFACE__
- #define __SQLITE3_INTERFACE__
- // #include "sqlite3.h"
- // #pragma comment(lib,"SQLite3.lib")
- #include "CharacterConvert.h"
- //////////////////////////////////////////////////////////////////////////
- // 创建表,注意:SQLite3每条SQL语句结束时需要加上分号;
- #define CREATE_DB_TBL_ _T("create table remoteinfo(\
- inuse int not null,\
- branch text not null,\
- ip text not null,\
- domain text not null, \
- host text null,\
- sharedirectory text null,\
- delaftertakeway int defualt(0),\
- deldays int null,\
- primary key(domain));")
- //////////////////////////////////////////////////////////////////////////
- typedef struct _STRemoteInfo_
- {
- int bInUse;
- // 店铺信息;
- TCHAR szBranch[MAX_PATH];
- TCHAR szIP[MAX_PATH];
- TCHAR szDoMain[MAX_PATH];
- // 共享信息;
- TCHAR szHost[MAX_PATH]; // 异地客户端所共享的选片机器;
- TCHAR szShareDirectory[MAX_PATH]; // 异地客户端所共享的选片机器目录;
- bool bDelAfterTakeWay; // 是否在取件完成后自动删除,如果否则读取dwDelDays;
- DWORD dwDelDays; // 选片OK后多少天自动删除;
- }STRemoteInfo,*pSTRemoteInfo;
- #pragma once
- class CSQLite3Interface
- {
- public:
- CSQLite3Interface();
- ~CSQLite3Interface();
- sqlite3 *m_pdb;
- bool m_bOpen;
- int excute(const TCHAR* pszexcu);
- int opendb(const TCHAR *pszdb);
- int closedb();
- int creattbl(const TCHAR *pszcreate);
- int isnerttbl(const TCHAR* pszInsert);
- int gettbl_remoteinfo(const TCHAR* pszSelect,vector<STRemoteInfo> &vtRemoteInfo);
- int removetbl(const TCHAR* pszdel);
- };
- #endif
|