12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- #ifndef __SQLITE3INTERFACE_H_
- #define __SQLITE3INTERFACE_H_
- #include <string>
- #ifndef _UNICODE
- typedef std::string TString;
- #else
- typedef wstring TString;
- #endif
- struct sqlite3;
- #define CREATE_DB_TBL_ "create table remoteinfo(\
- [domain] text not null,\
- [shopname] text not null,\
- [ipaddr] text not null,\
- [pcname] text not null,\
- [sharedir] text not null,\
- PRIMARY KEY([domain]));"
- typedef struct _STRemoteInfo_
- {
- int bInUse;
- TCHAR szBranch[MAX_PATH];
- TCHAR szIP[MAX_PATH];
- TCHAR szDoMain[MAX_PATH];
- }STRemoteInfo,*pSTRemoteInfo;
- class CSQLiter3Interface
- {
- public:
- CSQLiter3Interface();
- ~CSQLiter3Interface();
-
- int OpenSQLite3DB(const char* pDBPath);
-
- int CreateTabel(const char* pSql, CString& strError);
-
- int Exec(const char* pSql, CString& strError);
-
- const char* Get_ErrMsg();
-
- int Select(const char* pTableName, const char* pFields, const char* pLimit, std::vector<TString>& vValues, CString& strError);
-
- int Insert(const char* pTableName, const char* pFields, const char* pValues, CString& strError);
-
- int Delete(const char* pTableName, const char* pLimit, CString& strError);
-
- int Close();
- private:
- sqlite3* m_pSqli3db;
- };
- #endif
|