kexi

error.h
1/* This file is part of the KDE project
2 Copyright (C) 2003-2006 Jaroslaw Staniek <js@iidea.pl>
3 Copyright (C) 2003 Joseph Wenninger <jowenn@kde.org>
4
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this program; see the file COPYING. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19*/
20
21#ifndef _KEXI_ERROR_H_
22#define _KEXI_ERROR_H_
23
24#include <tqstring.h>
25
26#include "kexidb/kexidb_export.h"
27
30#define ERR_NONE 0
31#define ERR_NO_NAME_SPECIFIED 9
32#define ERR_DRIVERMANAGER 10
33#define ERR_INVALID_IDENTIFIER 11
34#define ERR_MISSING_DB_LOCATION 20
35#define ERR_ALREADY_CONNECTED 30
36#define ERR_NO_CONNECTION 40
37#define ERR_CONNECTION_FAILED 41
38#define ERR_CLOSE_FAILED 42
39#define ERR_NO_DB_USED 43
40#define ERR_OBJECT_EXISTS 50
41#define ERR_OBJECT_THE_SAME 51
42#define ERR_OBJECT_NOT_FOUND 60
43#define ERR_ACCESS_RIGHTS 70
44#define ERR_TRANSACTION_ACTIVE 80
45#define ERR_NO_TRANSACTION_ACTIVE 81
46#define ERR_NO_DB_PROPERTY 90
47#define ERR_DB_SPECIFIC 100
48#define ERR_CURSOR_NOT_OPEN 110
49#define ERR_SINGLE_DB_NAME_MISMATCH 120
50#define ERR_CURSOR_RECORD_FETCHING 130
51#define ERR_UNSUPPORTED_DRV_FEATURE 140
52#define ERR_ROLLBACK_OR_COMMIT_TRANSACTION 150
53#define ERR_SYSTEM_NAME_RESERVED 160
55#define ERR_CANNOT_CREATE_EMPTY_OBJECT 170
57#define ERR_INVALID_DRIVER_IMPL 180
58#define ERR_INCOMPAT_DRIVER_VERSION 181
59#define ERR_INCOMPAT_DATABASE_VERSION 182
61#define ERR_INVALID_DATABASE_CONTENTS 183
63
65#define ERR_UPDATE_NULL_PKEY_FIELD 190
66#define ERR_UPDATE_SERVER_ERROR 191
67#define ERR_UPDATE_NO_MASTER_TABLE 192
69#define ERR_UPDATE_NO_MASTER_TABLES_PKEY 193
72#define ERR_UPDATE_NO_ENTIRE_MASTER_TABLES_PKEY 194
75
77#define ERR_INSERT_NULL_PKEY_FIELD 220
78#define ERR_INSERT_SERVER_ERROR 221
79#define ERR_INSERT_NO_MASTER_TABLE 222
81#define ERR_INSERT_NO_MASTER_TABLES_PKEY 223
83#define ERR_INSERT_NO_ENTIRE_MASTER_TABLES_PKEY 224
86
88#define ERR_DELETE_NULL_PKEY_FIELD 250
89#define ERR_DELETE_SERVER_ERROR 251
90#define ERR_DELETE_NO_MASTER_TABLE 252
92#define ERR_DELETE_NO_MASTER_TABLES_PKEY 253
94#define ERR_DELETE_NO_ENTIRE_MASTER_TABLES_PKEY 254
97
99#define ERR_SQL_EXECUTION_ERROR 260
101#define ERR_SQL_PARSE_ERROR 270
102
103#define ERR_OTHER 0xffff
104
105
106namespace KexiDB {
107
110class KEXI_DB_EXPORT ResultInfo
111{
112 public:
113 ResultInfo()
114 {
115 success = true;
116 allowToDiscardChanges = false;
117 column = -1;
118 }
120 void clear() {
121 success = true;
122 allowToDiscardChanges = false;
123 column = -1;
124 msg = TQString();
125 desc = TQString();
126 }
127 bool success : 1;
131 TQString msg, desc;
132 int column;
133};
134
135}//namespace
136
137#endif
138
bool success
result of the operation, true by default
Definition error.h:127
int column
faulty column, -1 (the default) means: there is no faulty column
Definition error.h:132
TQString desc
error message and detailed description, both empty by default
Definition error.h:131
bool allowToDiscardChanges
True if changes can be discarded, false by default If true, additional "Discard changes" messagebox b...
Definition error.h:128
High-level database connectivity library with database backend drivers.