-
Notifications
You must be signed in to change notification settings - Fork 3
/
AdoDbRecordset.h
99 lines (74 loc) · 2.73 KB
/
AdoDbRecordset.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#pragma once
#include "SqlDriver.h"
class COMMON_DBLIB CAdoRecordset:public CDbRecordSet
{
public:
CAdoRecordset(_RecordsetPtr pRecordset);
~CAdoRecordset(void);
public:
//取字段个数
int GetFieldNum();
// 字段名
string GetFieldName(long lIndex);
int GetIndex(char* strFieldName);
// 字段数据类型
int GetFieldType(long lIndex);
int GetFieldType(char* lpszFieldName);
// 字段定义长度
int GetFieldDefineSize(long lIndex);
int GetFieldDefineSize(char* lpszFieldName);
//字段判断是否为NULL
bool IsFieldNull(char* lpFieldName);
bool IsFieldNull(int nIndex);
public:
bool IsNull();
bool IsEmpty();
bool IsNullEmpty();
void clear();
//判断执行是否成功
virtual bool IsSuccess();
public:
bool IsEOF();
bool IsBOF();
void MoveFirst() ;
void MoveNext();
void MovePrevious() ;
void MoveLast() ;
//设置光标位置
long GetCursorPos();
long SetCursorPos(long i);
//取结果集行数
int GetRowNum();
//获取数据实际长度
int GetValueSize(long lIndex);
int GetValueSize(char* lpszFieldName);
bool GetValue(int nColumns, _variant_t& vt, bool &nIsNull );
bool GetValue(char* strFieldName, _variant_t& vt, bool &nIsNull );
bool GetValue(int nColumns, bool& bValue, bool &nIsNull );
bool GetValue(char* strFieldName, bool& bValue, bool &nIsNull );
bool GetValue(int nColumns, byte& nValue, bool &nIsNull );
bool GetValue(char* strFieldName, byte& nValue, bool &nIsNull );
bool GetValue(int nColumns, short& nValue, bool &nIsNull );
bool GetValue(char* strFieldName, short& fValue, bool &nIsNull );
bool GetValue(int nColumns, int& nValue, bool &nIsNull );
bool GetValue(char* strFieldName, int& nValue, bool &nIsNull );
bool GetValue(int nColumns, long& lValue, bool &nIsNull );
bool GetValue(char* strFieldName, long& lValue, bool &nIsNull );
bool GetValue(int nColumns, __int64& lValue, bool &nIsNull );
bool GetValue(char* strFieldName, __int64& lValue, bool &nIsNull );
bool GetValue(int nColumns, float& fValue, bool &nIsNull );
bool GetValue(char* strFieldName, float& fValue, bool &nIsNull );
bool GetValue(int nColumns, double& dValue, bool &nIsNull );
bool GetValue(char* strFieldName, double& dValue, bool &nIsNull );
bool GetValue(int nColumns, string& strValue, bool &nIsNull );
bool GetValue(char* strFieldName, string& strValue, bool &nIsNull );
bool GetValue(int nColumns, char* strValue, short len,bool &nIsNull);
bool GetValue(char* strFldName, char* strValue, short len, bool &nIsNull);
bool GetValue(int nColumns, tm& time, bool &nIsNull );
bool GetValue(char* strFieldName, tm& time, bool &nIsNull );
bool GetValue(int nColumns, byte** bDat, long *len, bool &nIsNull );
bool GetValue(char* strFieldName, byte** bDat, long *len, bool &nIsNull );
private:
_RecordsetPtr m_pRecordset;
byte* m_blobData;
};