⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dbrecord.cpp

📁 自己编写的用户信息显示系统 包括了对数据库的简单操作 实现了连接
💻 CPP
字号:
// DBRecord.cpp: implementation of the CDBRecord class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "UserIn.h"
#include "DBRecord.h"

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

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

CDBRecord::CDBRecord()
{
	re.CreateInstance ("ADODB.Recordset");
	Actived=false;
}

CDBRecord::~CDBRecord()
{
	re.Release ();
}
bool CDBRecord::Open (CString str,CDBConnect * mcon)
{
	try
	{
		re->Open (_variant_t(str),mcon->con .GetInterfacePtr (),adOpenStatic,adLockOptimistic,adCmdText);
		Actived=true;
		return true;
	}
	catch(_com_error &e)
	{
		AfxMessageBox(e.ErrorMessage ());
		return false;
	}
}
void CDBRecord::Close ()
{
	if(Actived)
	{
		re->Close ();
	}
}

⌨️ 快捷键说明

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