/**//******************************************************************
???????????????????
????????????????????????????????????
?о???????????Σ?
????£?2010-05-12
????????
??1????stdafx.h?????
#import "C:Program FilesCommon FilesSystemadomsado15.dll" no_namespace rename("EOF"??"adoEOF")
??2???????????InitInstance()?????
if(!AfxOleInit())
{
AfxMessageBox("OLE?????????");
return FALSE;
}
??3????.cpp??????????"CPFile.h"
*********************************************************************/
/**//*****************************************************************
CPFile.h
******************************************************************/
class CPData
{
public:
//?????????????
CPData();
//??????????????
CPData(_ConnectionPtr pConnection);
//????????
virtual ~CPData();
public:
//?????????
BOOL Connect(CString strUser??CString strPassword??CString strFileName="ConnectionParam.udl"??int nOptions=-1??CString strConStr="Provider=sqloledb.1;Data Source=(local);Database=VLan");
//?????????????
void DisConnect();
//???????????????????????????ν??в??
//??????????TRUE????????FALSE.????????洢???????г??????m_pRecordset??
//???????????????????????????г??????m_nResultRow??m_nResultCol??
BOOL Select(CString strSql);
//??????????????????????ε???????д???
//????????CStringArray????????pResult??
BOOL Select(CString strSql??CStringArray& Result);
//??????ν??в??
BOOL SelectMulitCol(CString strSql??CStringArray& Result);
//????
BOOL OpenTable(CString strTable);
//????
BOOL OpenTable(CString strTable??CStringArray& Result);
//????????????2???
BOOL Execute(CString strSql);
public:
BOOL ExecuteTrans(CStringArray& aSql);
//?????????
void CloseRecordset();
//????????????????
long GetResultCol();
//????????????????
long GetResultRow();
//??????????
_RecordsetPtr GetResult();
private:
//???????????????????
long m_nResultRow;
//?????_RecordsetPtr??????
long m_nResultCol;
//???????
_ConnectionPtr m_pConnection;
//??????????
_CommandPtr m_pCommand;
//????????
_RecordsetPtr m_pRecordset;
};