📄 dbrecord.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 + -