-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathqsqloledb.h
More file actions
93 lines (77 loc) · 2.39 KB
/
qsqloledb.h
File metadata and controls
93 lines (77 loc) · 2.39 KB
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
/****************************************************************************
** QSQLOLEDB - Qt OLE DB Driver Plugin for Microsoft SQL Server
**
** Copyright (c) 2025 qsqloledb contributors
** Licensed under the MIT License. See LICENSE file for details.
****************************************************************************/
#ifndef QSQLOLEDB_H
#define QSQLOLEDB_H
#ifdef QSQLOLEDB_LIB
# define QSQLOLEDB_EXPORT Q_DECL_EXPORT
#else
# define QSQLOLEDB_EXPORT Q_DECL_IMPORT
#endif
class QSqlOLEDBDriver;
class QSqlOLEDBResultPrivate;
class QSqlOLEDBDriverPrivate;
struct RealConnectResult
{
QSqlError error;
CComPtr<IDBInitialize> spInit;
HRESULT res;
};
class QSQLOLEDB_EXPORT QSqlOLEDBResult : public QSqlResult
{
friend class QSqlOLEDBDriver;
public:
explicit QSqlOLEDBResult(const QSqlOLEDBDriver* db, QSqlOLEDBDriverPrivate* p);
virtual ~QSqlOLEDBResult();
QVariant handle() const;
bool exec();
bool prepare(const QString& query);
QSqlRecord record() const;
QVariant lastInsertId() const;
protected:
bool reset(const QString& query);
bool fetch(int i);
bool fetchFirst();
bool fetchLast();
bool fetchNext();
bool fetchPrevious();
QVariant data(int field);
bool isNull(int field);
int size();
int numRowsAffected();
void virtual_hook(int id, void *data);
private:
QSqlOLEDBResultPrivate* d;
QSqlOLEDBDriverPrivate* oldebd;
};
class QSQLOLEDB_EXPORT QSqlOLEDBDriver : public QSqlDriver
{
Q_OBJECT
public:
explicit QSqlOLEDBDriver(QObject *parent = 0);
virtual ~QSqlOLEDBDriver();
bool hasFeature(DriverFeature f) const;
bool open(const QString &db, const QString &user, const QString &password,
const QString &host, int port, const QString &connOpts);
void close();
QSqlResult *createResult() const;
bool beginTransaction();
bool commitTransaction();
bool rollbackTransaction();
QStringList tables(QSql::TableType) const;
QSqlRecord record(const QString& tablename) const;
QSqlIndex primaryIndex(const QString &table) const;
QVariant handle() const;
QString escapeIdentifier(const QString &identifier, IdentifierType) const;
QString formatValue(const QSqlField &field, bool trimStrings) const;
protected:
RealConnectResult realConnect(const QString &db, const QString &user,
const QString &password, const QString &host,
const QString &provider);
private:
QSqlOLEDBDriverPrivate* d;
};
#endif // QSQLOLEDB_H