📄 mydb.h
字号:
#if !defined(AFX_MYDB_H__0B8560B8_EB0B_4A29_8396_B57194C04788__INCLUDED_)
#define AFX_MYDB_H__0B8560B8_EB0B_4A29_8396_B57194C04788__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// myDb.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// myDb thread
#include "afxdb.h"
#include "sql.h"
#include "sqlext.h"
#include "odbcss.h"
class myDb : public CWinThread
{
DECLARE_DYNCREATE(myDb)
public:
myDb(); // protected constructor used by dynamic creation
// Attributes
public:
bool Loop;
private:
HENV henv;
HDBC hdbc;
HSTMT hstmt;
RETCODE rc;
SQLUSMALLINT RowStatusArray;
DWORD crow;
bool DBConnectFlag;
char InitErrorMessage[100];
unsigned char SqlOrder[256];
UCHAR select[512];
// Operations
public:
// BOOL ();
// BOOL ();
// BOOL ();
BOOL Close_DB();
BOOL ReadMeterParameter(unsigned char *buff);
BOOL ReadDayData(unsigned char *buff,char *id,BYTE month,BYTE day);
BOOL ReadMonthData(unsigned char *buff,char *id,BYTE month);
private:
BOOL Init_DB();
BOOL Init_Hdbc();
BOOL Init_Hstmt();
BOOL IsConnectDB();
BOOL OnReConnectDB();
BOOL OnTimerConnectDB();
BOOL Restore_Hdbc();
UINT SaveDayData(unsigned char *rec);
UINT SaveMonthData(unsigned char *rec);
UINT SaveTypeData(unsigned char *rec);
UINT SavePowerOff(unsigned char *rec);
UINT SaveCurrentVoltage(unsigned char *rec);
UINT SaveMeterParameter(unsigned char *rec);
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(myDb)
public:
virtual BOOL InitInstance();
virtual int ExitInstance();
virtual int Run();
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~myDb();
// Generated message map functions
//{{AFX_MSG(myDb)
// NOTE - the ClassWizard will add and remove member functions here.
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MYDB_H__0B8560B8_EB0B_4A29_8396_B57194C04788__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -