count.cpp

来自「毕业生信息管理系统的基本功能是对毕业生的信息进行管理」· C++ 代码 · 共 49 行

CPP
49
字号
// Count.cpp: implementation of the CCount class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "BySys.h"
#include "Count.h"
#include "ADOConn.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CCount::CCount()
{
	num = 0;

}

CCount::~CCount()
{

}

int CCount::GetCount(CString cSearch)
{
	int iCount;

	//连接数据库
	ADOConn m_AdoConn;
	m_AdoConn.OnInitADOConn();

	//设置COUNT语句
	_bstr_t vSQL;
	vSQL = "SELECT count('"+cSearch+"') from Base_Mat";
	//执行COUNT语句
	iCount = m_AdoConn.ExecuteSQL(vSQL);	
	//断开与数据库的连接
	m_AdoConn.ExitConnect();

	return iCount;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?