資源簡介
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個文件信息
評論
共有 條評論