#pragma once #include "SqlLibHandler.h" #include "WorkerThread.h" #include class CDBProc : public CWorkerThread { public: CDBProc(void); ~CDBProc(void); bool ConnectDBMS(char* strCon, char* szID, char* szPwd); bool ConnectDBMS(char* strIP, UINT nPortNum, char* szDbName, char* szID, char* szPwd, bool bDBConnect = true); bool SetQureyText(const char* szQurey); bool ExecSP(); protected: virtual void RunProc(); bool IsConnected(); int GetCountFiled(); bool FetchNext(); bool ModifyValue(VALUE_TYPE vt, const char* szCol, tm& _time); bool ModifyValue(VALUE_TYPE vt, const char* szCol, long& nValue); bool ModifyValue(VALUE_TYPE vt, const char* szCol, short& nValue); bool ModifyValue(VALUE_TYPE vt, const char* szCol, double& nValue); bool ModifyValue(VALUE_TYPE vt, const char* szCol, int& nValue); bool ModifyValue(VALUE_TYPE vt, const char* szCol, char& nValue); bool ModifyValue(VALUE_TYPE vt, const char* szCol, DWORD& nValue); bool ModifyValue(VALUE_TYPE vt, const char* szCol, WORD& nValue); bool ModifyValue(VALUE_TYPE vt, const char* szCol, BYTE& nValue); bool ModifyValue(VALUE_TYPE vt, const char* szCol, char* nValue, int Size); bool ModifyValue(VALUE_TYPE vt, const char* szCol, WCHAR* nValue, int Size); bool ModifyValue(VALUE_TYPE vt, const char* szCol, WCHAR& nValue); bool ModifyValue(VALUE_TYPE vt, const char* szCol, bool& nValue); std::wstring ConvertSQLString(WCHAR* sz); std::string ConvertSQLString(char* sz); private: CSqlLibHandler m_slqdb; };