资源简介
hrsm.rar
代码片段和文件信息
// ADOOperation.cpp: implementation of the CADOOperation class.
//
//////////////////////////////////////////////////////////////////////
#include “stdafx.h“
#include “hrms.h“
#include “ADOOperation.h“
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
const DWORD CADOOperation::ADO_TYPE_STRING = 100;
const DWORD CADOOperation::ADO_TYPE_BITMAP_FIEL = 101;
const DWORD CADOOperation::ADO_TYPE_INT = 102;
const DWORD CADOOperation::ADO_TYPE_FLOAT = 103;
const DWORD CADOOperation::ADO_TYPE_DATE = 104;
const DWORD CADOOperation::ADO_TYPE_BITMAP_HANDLE = 105;
const DWORD CADOOperation::ADO_TYPE_TEXT = 106;
CADOOperation::CADOOperation()
{
try{
m_pConnection.CreateInstance(_uuidof(Connection));
m_pConnection->Open(_bstr_t(Provider) ““ ““ adModeUnknown);
}
catch(_com_error e)
{
AfxMessageBox(e.Description() MB_OK);
exit(0);
}
m_pRecordset.CreateInstance(_uuidof(Recordset));
m_CurrentRecord = -1;
}
CADOOperation::~CADOOperation()
{
m_pConnection->Close();
}
BOOL CADOOperation::OpenTable(CString name)
{
ASSERT(!name.IsEmpty());
CString sql;
sql.Format(“select * from %s“ name);
try
{
m_pRecordset->Open(_bstr_t(sql)
m_pConnection.GetInterfacePtr()
adOpenDynamic adLockOptimistic adCmdText);
}
catch(_com_error e)
{
#ifdef _DEBUG
ShowError(e.Description());
#endif
return FALSE;
}
return TRUE;
}
BOOL CADOOperation::CloseTable()
{
try
{
if(adStateOpen == m_pRecordset->GetState())
m_pRecordset->Close();
}
catch(_com_error e)
{
return FALSE;
}
return TRUE;
}
HRESULT CADOOperation::AddNew()
{
return m_pRecordset->AddNew();
}
BOOL CADOOperation::UpdateData()
{
try
{
m_pRecordset->Update();
}
catch(_com_error e)
{
#ifdef _DEBUG
ShowError(e.Description());
#endif
return FALSE;
}
return TRUE;
}
BOOL CADOOperation::SetItemContent(CString field
DWORD type
const void *variable)
{
ASSERT(!field.IsEmpty());
ASSERT(variable != NULL);
try
{
switch(type)
{
case ADO_TYPE_STRING:
m_pRecordset->PutCollect(_bstr_t(field) _bstr_t(*(CString*)(variable)));
break;
case ADO_TYPE_BITMAP_FIEL:
{
CString* lpStr = (CString*)variable;
VARIANT bitData = {0};
CFile file(*lpStr CFile::modeRead);
DWORD fileSize = file.GetLength() + 1;
char* bitBuffer = new char[fileSize];
file.ReadHuge(bitBuffer fileSize);
file.Close();
bitData.vt = VT_ARRAY | VT_UI1;
SAFEARRAY* pSafeArray;
SAFEARRAYBOUND arrayBound[1];
arrayBound[0].cElements = fileSize - 1;
arrayBound[0].lLbound = 0;
pSafeArray = ::SafeArrayCreate(VT_UI1 1 arrayBound);
for(l
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 7340032 2013-08-08 21:17 hrsm\Databa
文件 1310720 2013-08-08 21:17 hrsm\Databa
文件 13610 2008-02-18 16:09 hrsm\HRMS\ADOOperation.cpp
文件 1771 2008-02-16 16:19 hrsm\HRMS\ADOOperation.h
文件 1104 2008-01-26 10:51 hrsm\HRMS\ADOView.cpp
文件 681 2008-01-14 18:44 hrsm\HRMS\ADOView.h
文件 4714 2008-02-16 13:18 hrsm\HRMS\AgreementListDlg.cpp
文件 1746 2008-02-16 13:17 hrsm\HRMS\AgreementListDlg.h
文件 10816 2008-01-24 15:05 hrsm\HRMS\ApplerInfo.cpp
文件 1509 2008-01-17 13:05 hrsm\HRMS\ApplerInfo.h
文件 9278 2008-01-26 11:13 hrsm\HRMS\ApplerList.cpp
文件 2007 2008-01-25 18:42 hrsm\HRMS\ApplerList.h
文件 3639 2008-01-18 16:46 hrsm\HRMS\ApplerSearchDlg.cpp
文件 1422 2008-01-17 10:20 hrsm\HRMS\ApplerSearchDlg.h
文件 10767 2008-01-18 18:45 hrsm\HRMS\ApplyEmployeeDlg.cpp
文件 1618 2008-01-17 18:48 hrsm\HRMS\ApplyEmployeeDlg.h
文件 3955 2008-01-18 17:10 hrsm\HRMS\AssessDlg.cpp
文件 1345 2008-01-10 14:30 hrsm\HRMS\AssessDlg.h
文件 10245 2008-01-26 12:49 hrsm\HRMS\AssessList.cpp
文件 2011 2008-01-18 14:59 hrsm\HRMS\AssessList.h
文件 4107 2008-01-24 10:28 hrsm\HRMS\AssessSearchDlg.cpp
文件 1498 2008-01-24 10:28 hrsm\HRMS\AssessSearchDlg.h
文件 10965 2008-01-18 17:44 hrsm\HRMS\BargainDlg.cpp
文件 1805 2008-01-07 12:56 hrsm\HRMS\BargainDlg.h
文件 184792 2008-02-18 16:09 hrsm\HRMS\Debug\ADOOperation.obj
文件 6276 2008-02-18 10:32 hrsm\HRMS\Debug\ADOView.obj
文件 31585 2008-02-18 10:32 hrsm\HRMS\Debug\AgreementListDlg.obj
文件 39695 2008-02-18 10:32 hrsm\HRMS\Debug\ApplerInfo.obj
文件 61477 2008-02-18 10:32 hrsm\HRMS\Debug\ApplerList.obj
文件 22398 2008-02-18 10:32 hrsm\HRMS\Debug\ApplerSearchDlg.obj
............此处省略270个文件信息
相关资源
- 志汇同城8.1前后端带教程数据库.zip
- NETMemoryProfiler5.0.zip
- designofanalogcmosinegratedcircuits(razavi-2
- 199804.txt
- 3.3.rar
- poker-game-demo-master.zip
- 第二行代码-图灵社区版.pdf
- 赠PDF版数据库系统概论习题解析与实
- VisualBasic编程晋级:ActiveX控件.rar
- QT5中使用QHttpQFtp.rar
- inputnew_V20171109.zip
- 12.2.rar
- 运算放大器权威指南_第4版_[美卡特
- yn16r9.rar
- APrimerForTheMathematicsOfFinancialEngineering
- 基于OpenMV与STM32的寻球小车.7z
- 工程优化.zip
- areful_1238702.zip
- aqqabqqb_10417087.zip
- OfficeFix破解版.zip
- 12526903130405sjel5vg7l8i848zz.rar
- cf自动开枪源码.e
- Shp.rar
- 传智播客.net黑马5期视频全套未加密
- Beautiful-Visualization.pdf
- QQLocation.zip
- ilo2.61ilo4高级激活码.rar
- 电路原理邱关源第五版教材+习题全解
- Office密码破解工具内含注册码.rar
- 车辆悬架设计及理论.pdf
评论
共有 条评论