You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kev/Drawer/SSBase/DrawOperator/RecordsetDynamicBind.h

68 lines
1.6 KiB
C++

//////////////////////////////////////////////////////////////////////////////
//文件 RecordsetDynamicBind.h
//主要功能:
//
//程序编写: 2005-12-07
/////////////////////////////////////////////////////////////////////////////
#pragma once
#include "afxdb.h"
namespace NOperatorDB
{
class CRecordsetDynamicBind :
public CRecordset
{
DECLARE_DYNAMIC(CRecordsetDynamicBind)
public:
CRecordsetDynamicBind(CDatabase* pDatabase = NULL);
~CRecordsetDynamicBind(void);
//增加一个动态绑定的域名,这些函数必须在调用Open之前Close状态下使用
void SetDefaultConnect(LPCTSTR lpszConnect);
void SetTableName(LPCTSTR lpszTableName);
BOOL AddBindField(LPCTSTR lpszFieldName, int nFieldType);
void SetFieldValue(int nIndex, CString strValue);
CString GetFieldValue(int nIndex);
ULONGLONG SetLongBinaryFieldValue(int nIndex, CString strFileName); //返回文件长度
BOOL GetLongBinaryFieldValue(int nIndex, CString strFileName);
BOOL RemoveBindField(CString strFieldName);
BOOL RemoveBindField(int nIndex);
void RemoveAllField(void);
static bool IsLongBinaryField(int nFieldType);
protected:
class CField
{
public:
CField() {nType=0; name=_T("");}
int nType;
CString name;
};
CPtrArray m_ptrFieldName;
CPtrArray m_ptrFieldValue;
CString m_strTableName;
CString m_strConnect;
void ToDateTime(CString& strValue, CTime& time);
// Implementation
protected:
virtual CString GetDefaultConnect(); // Default connection string
virtual CString GetDefaultSQL(); // default SQL for Recordset
virtual void DoFieldExchange(CFieldExchange* pFX); // RFX support
};
};
using namespace NOperatorDB;