comsetdm.cpp
来自「本程序采用VC++和MySql编写的田间信息自动采集系统」· C++ 代码 · 共 57 行
CPP
57 行
// ComSetDM.cpp: implementation of the CComSetDM class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "rt.h"
#include "ComSetDM.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
#define CREATETABLE "create table ComSet (stopBit char(5),hand char(10),port char(5) ,parity char(5), dataBit char(5) , baudRate char(5))"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CComSetDM::CComSetDM()
{
m_sTableName = _T("ComSet");
if(!ExistTable(m_sTableName)){
CreateTable(CREATETABLE);
CString temp = "insert into ComSet values (";
temp += "'1','None','COM3','N','8','2400')";
//AfxMessageBox(temp);
Insert(temp);
}
}
CComSetDM::~CComSetDM()
{
}
void CComSetDM::Add(CString sql)
{
Insert(sql);
return;
}
void CComSetDM::Modify(CString sql)
{
Update(sql);
return;
}
CCustResultSet CComSetDM::select()
{
SetSql("select * from "+m_sTableName);
return Exculte();
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?