Patch level : 12.0 no-patch

Files correlati     : xvtext, include
Commento            :
- Allineato codice xvtdb a standard C++ > 2011 sostituendo i char* a const char*
- Pulito codice generale con refactor di nomi, aggiunta di const
- Aggiunta funzione sq_get_token_text_error che trasforma sq_get_text_error in una TToken_string (separatore \n) e poi torna il token scelto
This commit is contained in:
Mattia Tollari 2019-03-19 16:45:34 +01:00
parent 6e7d8ab89a
commit 724fced6a1
5 changed files with 81 additions and 116 deletions

View File

@ -95,6 +95,12 @@ TFieldtypes SSimple_query::sq_get_type_field(const unsigned column) const
return _nullfld; return _nullfld;
} }
const char* SSimple_query::sq_get_token_text_error(const int token, const bool erase)
{
TToken_string errors(sq_get_text_error(erase), '\n');
return errors.get(token);
}
void TDB_recordset::reset() void TDB_recordset::reset()
{ {
_current_row = -1; _current_row = -1;

View File

@ -105,7 +105,7 @@ public:
/**< Ritorno la versione del Client che sto utilizzando */ /**< Ritorno la versione del Client che sto utilizzando */
const long sq_get_client_v() { return _rec.get_client_v(); } const long sq_get_client_v() { return _rec.get_client_v(); }
/**< Ritorno la versione del Server che sto utilizzando */ /**< Ritorno la versione del Server che sto utilizzando */
const char* sq_get_server_v() { return _rec.getServerV(); } const char* sq_get_server_v() { return _rec.get_server_v(); }
/**< Ritorno la versione del Server che sto utilizzando in formato numerico */ /**< Ritorno la versione del Server che sto utilizzando in formato numerico */
const long sq_get_server_vn() { return _rec.get_server_vn(); } const long sq_get_server_vn() { return _rec.get_server_vn(); }
/**< Ritorno se il recordset è carico */ /**< Ritorno se il recordset è carico */
@ -187,6 +187,7 @@ public:
const char* sq_get_string_error(const bool erase = true) { return _rec.get_string_error(erase); } const char* sq_get_string_error(const bool erase = true) { return _rec.get_string_error(erase); }
/**< Ritorno l'ultima stringa di errore segnalato in formato (const char *) */ /**< Ritorno l'ultima stringa di errore segnalato in formato (const char *) */
const char* sq_get_text_error(const bool erase = true) { return _rec.get_text_error(erase); } const char* sq_get_text_error(const bool erase = true) { return _rec.get_text_error(erase); }
const char* sq_get_token_text_error(const int token, const bool erase = true);
// Gestione freeze // Gestione freeze
/**< Controlla se il cursore è bloccato */ /**< Controlla se il cursore è bloccato */

View File

@ -6,7 +6,7 @@
#define _RCS(a) ((SACommand *)a) #define _RCS(a) ((SACommand *)a)
#define _ERR(a) ((SAException *)a) #define _ERR(a) ((SAException *)a)
#define _CPY_STR(from,to) (to = strdup(from)); #define _CPY_STR(from,to) (to = _strdup(from));
#define _GET_ERROR(from,to) _CPY_STR(from,to) #define _GET_ERROR(from,to) _CPY_STR(from,to)
#define CHECK_FREEZED if (is_freezed()) { return set_error_freezed(); } #define CHECK_FREEZED if (is_freezed()) { return set_error_freezed(); }
@ -33,17 +33,16 @@ TXvt_recordset::TXvt_recordset() : _freezed(false)
} }
TXvt_recordset::TXvt_recordset(const char* db, const char* user, const char* pass, TT_driver tipoDb, const char * query, const bool ex, const bool freezed) TXvt_recordset::TXvt_recordset(const char* db, const char* user, const char* pass, const TT_driver tipo_db, const char * query, const bool ex, const bool freezed)
: _db(db), _usr(user), _psw(pass), _drv(tipoDb), _freezed(false) : _db(db), _usr(user), _psw(pass), _drv(tipo_db), _query(""), _recno(0), _freezed(false), _loaded(false)
{ {
_con = new SAConnection; _con = new SAConnection;
if(connect(db, user, pass, tipoDb) == NOERR) if(connect(db, user, pass, tipo_db) == NOERR)
{ {
try try
{ {
_recset = new SACommand; _recset = new SACommand;
_RCS(_recset)->setConnection(_CON(_con)); _RCS(_recset)->setConnection(_CON(_con));
// if (query[0] != '\0')
if (query && *query) if (query && *query)
{ {
set(query); set(query);
@ -110,33 +109,8 @@ TT_driver TXvt_recordset::str_to_driver(const char* tipo_db)
return tipoDb_driver; return tipoDb_driver;
} }
int strcmp_ins(const char* str1, const char* str2) TXvt_recordset::TXvt_recordset(const char* db, const char* user, const char* pass, const char* tipo_db,
{ const char* query, const bool ex, const bool freezed) : TXvt_recordset(db, user, pass, str_to_driver(tipo_db), query, ex, freezed)
int len1 = strlen(str1) + 1;
int len2 = strlen(str2) + 1;
char * str1_up = new char[len1];
char * str2_up = new char[len2];
strcpy_s(str1_up, len1, str1);
strcpy_s(str2_up, len2, str2);
char *p = str1_up;
char *q = str2_up;
while (*p != '\0')
{
*p = toupper(*p);
p++;
}
while (*q != '\0')
{
*q = toupper(*q);
q++;
}
return strcmp(str1_up, str2_up);
}
TXvt_recordset::TXvt_recordset(const char* db, const char* user, const char* pass, const char* tipoDb,
const char* query, const bool ex, const bool freezed) : TXvt_recordset(db, user, pass, str_to_driver(tipoDb), query, ex, freezed)
{ {
} }
@ -156,9 +130,9 @@ TXvt_recordset::~TXvt_recordset()
/* PRIVATE FUNCTIONS **************************************************************************************************/ /* PRIVATE FUNCTIONS **************************************************************************************************/
const bool TXvt_recordset::checkPermission() const bool TXvt_recordset::check_permission()
{ {
bool err = is_freezed(); const bool err = is_freezed();
if (err) if (err)
set_error_freezed(); set_error_freezed();
return !err; return !err;
@ -172,17 +146,17 @@ const bool TXvt_recordset::checkPermission()
int TXvt_recordset::connect(const char* db, const char* user, const char* pass, TT_driver tipo_db) int TXvt_recordset::connect(const char* db, const char* user, const char* pass, TT_driver tipo_db)
{ {
if (_con != NULL) if (_con != nullptr)
{ {
// Se è già connesso lo scollego // Se è già connesso lo scollego
if (_CON(_con)->isConnected()) if (_CON(_con)->isConnected())
_CON(_con)->Disconnect(); _CON(_con)->Disconnect();
SAString dbAddress = db; SAString db_address = db;
SAString usr = user; SAString usr = user;
SAString psw = pass; const SAString psw = pass;
SAClient_t dbDriver = (SAClient_t)tipo_db; const SAClient_t db_driver = static_cast<SAClient_t>(tipo_db);
if (dbAddress.IsEmpty() || usr.IsEmpty()) if (db_address.IsEmpty() || usr.IsEmpty())
{ {
_code_error = NOT_INITIALIZED; _code_error = NOT_INITIALIZED;
_string_error = NOT_INITIALIZEDS; _string_error = NOT_INITIALIZEDS;
@ -192,7 +166,7 @@ int TXvt_recordset::connect(const char* db, const char* user, const char* pass,
try try
{ {
// Mi collego // Mi collego
_CON(_con)->Connect(dbAddress, usr, psw, dbDriver); _CON(_con)->Connect(db_address, usr, psw, db_driver);
// Imposto che non si possono vedere i record non committati // Imposto che non si possono vedere i record non committati
_CON(_con)->setIsolationLevel(SA_ReadCommitted); _CON(_con)->setIsolationLevel(SA_ReadCommitted);
_CPY_STR(db, _db); _CPY_STR(db, _db);
@ -231,7 +205,7 @@ void TXvt_recordset::disconnect()
} }
} }
bool TXvt_recordset::commit(bool autoRoll) bool TXvt_recordset::commit(const bool auto_roll)
{ {
CHECK_FREEZED CHECK_FREEZED
try try
@ -240,7 +214,7 @@ bool TXvt_recordset::commit(bool autoRoll)
} }
catch (SAException &x) catch (SAException &x)
{ {
if (autoRoll) if (auto_roll)
{ {
rollback(); rollback();
} }
@ -269,17 +243,17 @@ bool TXvt_recordset::rollback()
return true; return true;
} }
void TXvt_recordset::set_client(TT_driver client) void TXvt_recordset::set_client(TT_driver client) const
{ {
_CON(_con)->setClient((SAClient_t) client); _CON(_con)->setClient(static_cast<SAClient_t>(client));
} }
void TXvt_recordset::set_con_option(const char* opt) void TXvt_recordset::set_con_option(const char* opt) const
{ {
_CON(_con)->setOption(opt); _CON(_con)->setOption(opt);
} }
void TXvt_recordset::set_autocommit(bool ac) void TXvt_recordset::set_autocommit(const bool ac) const
{ {
_CON(_con)->setAutoCommit(ac ? SA_AutoCommitOn : SA_AutoCommitOff); _CON(_con)->setAutoCommit(ac ? SA_AutoCommitOn : SA_AutoCommitOff);
} }
@ -294,7 +268,7 @@ void TXvt_recordset::set_visibility(iso_lvl vis)
* 2 -> Repeatable read. * 2 -> Repeatable read.
* 3 -> Serializable. * 3 -> Serializable.
*/ */
_CON(_con)->setIsolationLevel((SAIsolationLevel_t)vis); _CON(_con)->setIsolationLevel(static_cast<SAIsolationLevel_t>(vis));
} }
const bool TXvt_recordset::is_connect() const const bool TXvt_recordset::is_connect() const
@ -305,27 +279,27 @@ const bool TXvt_recordset::is_alive() const
{ {
return _CON(_con)->isAlive(); return _CON(_con)->isAlive();
} }
int TXvt_recordset::get_visibility() int TXvt_recordset::get_visibility() const
{ {
return (iso_lvl)_CON(_con)->IsolationLevel(); return static_cast<iso_lvl>(_CON(_con)->IsolationLevel());
} }
bool TXvt_recordset::get_autocommit() bool TXvt_recordset::get_autocommit() const
{ {
return _CON(_con)->AutoCommit() == SA_AutoCommitOn; return _CON(_con)->AutoCommit() == SA_AutoCommitOn;
} }
const char* TXvt_recordset::get_option(const char* opt) const char* TXvt_recordset::get_option(const char* opt) const
{ {
return _CON(_con)->Option(opt); return _CON(_con)->Option(opt);
} }
long TXvt_recordset::get_client_v() long TXvt_recordset::get_client_v() const
{ {
return _CON(_con)->ClientVersion(); return _CON(_con)->ClientVersion();
} }
const char* TXvt_recordset::getServerV() const char* TXvt_recordset::get_server_v() const
{ {
return _CON(_con)->ServerVersionString(); return _CON(_con)->ServerVersionString();
} }
long TXvt_recordset::get_server_vn() long TXvt_recordset::get_server_vn() const
{ {
return _CON(_con)->ServerVersion(); return _CON(_con)->ServerVersion();
} }
@ -340,12 +314,12 @@ long TXvt_recordset::items()
// Per non creare casini utilizzo una funzione apposita che mi ritorna il numero // Per non creare casini utilizzo una funzione apposita che mi ritorna il numero
P_CONN_VOID conn = new SAConnection; P_CONN_VOID conn = new SAConnection;
SAString q; SAString q;
long items = -1; long items = DEFAULT_ERR_NUMBER;
// Connetto la nuova istanza // Connetto la nuova istanza
try try
{ {
_CON(conn)->Connect(_db, _usr, _psw, (SAClient_t)_drv); _CON(conn)->Connect(_db, _usr, _psw, static_cast<SAClient_t>(_drv));
items = xvt_rcs_get_items(conn, _query); items = xvt_rcs_get_items(conn, _query);
if (conn != _con) if (conn != _con)
delete conn; delete conn;
@ -395,7 +369,7 @@ bool TXvt_recordset::set(const char* query)
return true; return true;
} }
bool TXvt_recordset::exec(bool autoF) bool TXvt_recordset::exec(const bool auto_f)
{ {
CHECK_FREEZED CHECK_FREEZED
bool ok = false; bool ok = false;
@ -403,10 +377,10 @@ bool TXvt_recordset::exec(bool autoF)
{ {
_RCS(_recset)->Execute(); _RCS(_recset)->Execute();
_loaded = true; _loaded = true;
_recno = -1; _recno = DEFAULT_ERR_NUMBER;
// Se trovo almeno un "select" faccio l'autofetch // Se trovo almeno un "select" faccio l'autofetch
SAString s = _RCS(_recset)->CommandText(); s.MakeUpper(); SAString s = _RCS(_recset)->CommandText(); s.MakeUpper();
ok = s.Find("SELECT") != SIZE_MAX && autoF ? next() : true; ok = s.Find("SELECT") != SIZE_MAX && auto_f ? next() : true;
} }
catch (SAException &x) catch (SAException &x)
{ {
@ -418,7 +392,7 @@ bool TXvt_recordset::exec(bool autoF)
return ok; return ok;
} }
bool TXvt_recordset::set_exec(const char* query, bool auto_f) bool TXvt_recordset::set_exec(const char* query, const bool auto_f)
{ {
set(query); set(query);
return exec(auto_f); return exec(auto_f);
@ -487,14 +461,6 @@ bool TXvt_recordset::first()
bool TXvt_recordset::last() bool TXvt_recordset::last()
{ {
/* La vita sarebbe molto bella se potessi chiamare la funzione FetchLast(),
// siccome non so la posizione del record eseguo ciclicamente Next
// _RCS(_recset)->FetchLast();
while (Next())
{
_recno++;
}
*/
bool fetched = false; bool fetched = false;
try try
{ {
@ -513,10 +479,10 @@ bool TXvt_recordset::last()
return fetched; return fetched;
} }
bool TXvt_recordset::go(int new_pos) bool TXvt_recordset::go(const int new_pos)
{ {
// Controllo che la nuova posizione non sia fuori dal limite inferiore (Non so quanto è grande il recordset) // Controllo che la nuova posizione non sia fuori dal limite inferiore (Non so quanto è grande il recordset)
bool result = new_pos >= 0 ? true : false; bool result = new_pos >= 0;
// Se la posizione è minore mi sposto indietro // Se la posizione è minore mi sposto indietro
while (new_pos < _recno && result) while (new_pos < _recno && result)
@ -528,13 +494,7 @@ bool TXvt_recordset::go(int new_pos)
{ {
result = next(); result = next();
} }
/*
// Controllo finale per prevenire errori
if (newPos == _recno)
return true;
else
return false;
*/
return result; return result;
} }
@ -554,7 +514,7 @@ int TXvt_recordset::get_int(const char* field)
_code_error = x.ErrNativeCode(); _code_error = x.ErrNativeCode();
_GET_ERROR(x.ErrMessage(), _string_error); _GET_ERROR(x.ErrMessage(), _string_error);
_GET_ERROR(x.ErrText(), _string_error_full_text); _GET_ERROR(x.ErrText(), _string_error_full_text);
return -1; return DEFAULT_ERR_NUMBER;
} }
} }
@ -569,7 +529,7 @@ short TXvt_recordset::get_short(const char* field)
_code_error = x.ErrNativeCode(); _code_error = x.ErrNativeCode();
_GET_ERROR(x.ErrMessage(), _string_error); _GET_ERROR(x.ErrMessage(), _string_error);
_GET_ERROR(x.ErrText(), _string_error_full_text); _GET_ERROR(x.ErrText(), _string_error_full_text);
return -1; return DEFAULT_ERR_NUMBER;
} }
} }
@ -584,7 +544,7 @@ long TXvt_recordset::get_long(const char* field)
_code_error = x.ErrNativeCode(); _code_error = x.ErrNativeCode();
_GET_ERROR(x.ErrMessage(), _string_error); _GET_ERROR(x.ErrMessage(), _string_error);
_GET_ERROR(x.ErrText(), _string_error_full_text); _GET_ERROR(x.ErrText(), _string_error_full_text);
return -1; return DEFAULT_ERR_NUMBER;
} }
} }
@ -599,7 +559,7 @@ double TXvt_recordset::get_double(const char* field)
_code_error = x.ErrNativeCode(); _code_error = x.ErrNativeCode();
_GET_ERROR(x.ErrMessage(), _string_error); _GET_ERROR(x.ErrMessage(), _string_error);
_GET_ERROR(x.ErrText(), _string_error_full_text); _GET_ERROR(x.ErrText(), _string_error_full_text);
return -1; return DEFAULT_ERR_NUMBER;
} }
} }
@ -617,12 +577,7 @@ bool TXvt_recordset::get_bool(const char* field)
return false; return false;
} }
} }
/*
real TXvt_recordset::GetReal(const char * field)
{
return Get(field);
}
*/
const char* TXvt_recordset::get_date(const char * field) const char* TXvt_recordset::get_date(const char * field)
{ {
try try
@ -637,7 +592,7 @@ const char* TXvt_recordset::get_date(const char * field)
_code_error = x.ErrNativeCode(); _code_error = x.ErrNativeCode();
_GET_ERROR(x.ErrMessage(), _string_error); _GET_ERROR(x.ErrMessage(), _string_error);
_GET_ERROR(x.ErrText(), _string_error_full_text); _GET_ERROR(x.ErrText(), _string_error_full_text);
return NULL; return DEFAULT_ERR_STRING;
} }
} }
@ -656,7 +611,7 @@ const char* TXvt_recordset::get(const char* field)
_code_error = x.ErrNativeCode(); _code_error = x.ErrNativeCode();
_GET_ERROR(x.ErrMessage(), _string_error); _GET_ERROR(x.ErrMessage(), _string_error);
_GET_ERROR(x.ErrText(), _string_error_full_text); _GET_ERROR(x.ErrText(), _string_error_full_text);
return ""; return DEFAULT_ERR_STRING;
} }
} }
@ -673,7 +628,7 @@ const char* TXvt_recordset::get(unsigned int field)
_code_error = x.ErrNativeCode(); _code_error = x.ErrNativeCode();
_GET_ERROR(x.ErrMessage(), _string_error); _GET_ERROR(x.ErrMessage(), _string_error);
_GET_ERROR(x.ErrText(), _string_error_full_text); _GET_ERROR(x.ErrText(), _string_error_full_text);
return '\0'; return DEFAULT_ERR_STRING;
} }
} }
@ -688,7 +643,7 @@ char TXvt_recordset::get_char(const char* field)
_code_error = x.ErrNativeCode(); _code_error = x.ErrNativeCode();
_GET_ERROR(x.ErrMessage(), _string_error); _GET_ERROR(x.ErrMessage(), _string_error);
_GET_ERROR(x.ErrText(), _string_error_full_text); _GET_ERROR(x.ErrText(), _string_error_full_text);
return '\0'; return DEFAULT_ERR_CHAR;
} }
} }
@ -753,9 +708,9 @@ const char* TXvt_recordset::get_type_field(const unsigned column) const
} }
} }
long TXvt_recordset::get_code_error(bool erase) long TXvt_recordset::get_code_error(const bool erase)
{ {
long app = _code_error; const long app = _code_error;
if (erase) if (erase)
_code_error = NOERR; _code_error = NOERR;
return app; return app;

View File

@ -70,11 +70,11 @@ protected:
/**< Driver */ /**< Driver */
TT_driver _drv; TT_driver _drv;
/**< Query */ /**< Query */
const char* _query; const char* _query{};
/**< Ultima stringa con codice di errore ricevuto */ /**< Ultima stringa con codice di errore ricevuto */
char* _string_error; const char* _string_error;
/**< Ultima stringa con codice di errore ricevuto full text */ /**< Ultima stringa con codice di errore ricevuto full text */
char* _string_error_full_text; const char* _string_error_full_text;
/**< Ultimo codice di errore ricevuto */ /**< Ultimo codice di errore ricevuto */
long _code_error; long _code_error;
/**< Numero record corrente */ /**< Numero record corrente */
@ -84,7 +84,7 @@ protected:
/**< Indica se il cursore è caricato */ /**< Indica se il cursore è caricato */
bool _loaded; bool _loaded;
const bool checkPermission(); const bool check_permission();
private: private:
// Disabilito il copy constructor // Disabilito il copy constructor
@ -94,10 +94,10 @@ public:
/**< Costruttore, crea un oggetto vuoto, PERICOLOSO!! Ricordarsi di inizializzarlo opportunamente con il metodo connect() e set() */ /**< Costruttore, crea un oggetto vuoto, PERICOLOSO!! Ricordarsi di inizializzarlo opportunamente con il metodo connect() e set() */
TXvt_recordset(); TXvt_recordset();
/**< Costruttore, crea un oggetto dai parametri di connessione passati */ /**< Costruttore, crea un oggetto dai parametri di connessione passati */
TXvt_recordset(const char* db, const char* user, const char* pass, TT_driver tipoDb, const char * query = "", const bool ex = false, const bool freezed = false); TXvt_recordset(const char* db, const char* user, const char* pass, TT_driver tipo_db, const char * query = "", const bool ex = false, const bool freezed = false);
static TT_driver str_to_driver(const char* tipo_db); static TT_driver str_to_driver(const char* tipo_db);
/**< Costruttore, crea un oggetto dai parametri di connessione passati, chiama costruttore con TT_driver */ /**< Costruttore, crea un oggetto dai parametri di connessione passati, chiama costruttore con TT_driver */
TXvt_recordset(const char* db, const char* user, const char* pass, const char* tipoDb, const char * query = "", const bool ex = false, const bool freezed = false); TXvt_recordset(const char* db, const char* user, const char* pass, const char* tipo_db, const char * query = "", const bool ex = false, const bool freezed = false);
/**< Distruttore */ /**< Distruttore */
~TXvt_recordset(); ~TXvt_recordset();
@ -118,18 +118,18 @@ public:
/* Mi scollego */ /* Mi scollego */
void disconnect(); void disconnect();
/**< Esegue la commit, di default in caso di errore viene chiamato il metodo rollback() */ /**< Esegue la commit, di default in caso di errore viene chiamato il metodo rollback() */
bool commit(bool autoRoll = true); bool commit(bool auto_roll = true);
/**< Esegue il rollback all'ultimo commit */ /**< Esegue il rollback all'ultimo commit */
bool rollback(); bool rollback();
// Setters // Setters
/**< Imposto il tipo di client che utilizzo */ /**< Imposto il tipo di client che utilizzo */
void set_client(TT_driver client); void set_client(TT_driver client) const;
// Imposto una opzione generica dellla connessione // Imposto una opzione generica dellla connessione
void set_con_option(const char* opt); void set_con_option(const char* opt) const;
/**< Abilito/Disabilito l'autocommit, (disabilitato di default) */ /**< Abilito/Disabilito l'autocommit, (disabilitato di default) */
void set_autocommit(bool ac); void set_autocommit(bool ac) const;
/**< Imposta la visibilità delle transazioni (vedi Funzione) */ /**< Imposta la visibilità delle transazioni (vedi Funzione) */
void set_visibility(iso_lvl vis = committed); void set_visibility(iso_lvl vis = committed);
@ -140,17 +140,17 @@ public:
/**< Ritorna se la connessione è attiva */ /**< Ritorna se la connessione è attiva */
const bool is_alive() const; const bool is_alive() const;
/**< Ritorna la visibilità impostata */ /**< Ritorna la visibilità impostata */
int get_visibility(); int get_visibility() const;
/**< Ritorna se è attivo l'autocommit, true -> attivo, false -> disattivo o sconosciuto */ /**< Ritorna se è attivo l'autocommit, true -> attivo, false -> disattivo o sconosciuto */
bool get_autocommit(); bool get_autocommit() const;
/**< Ritorna il valore dell'opzione specificata */ /**< Ritorna il valore dell'opzione specificata */
const char* get_option(const char* opt); const char* get_option(const char* opt) const;
/**< Ritorno la versione del Client che sto utilizzando */ /**< Ritorno la versione del Client che sto utilizzando */
long get_client_v(); long get_client_v() const;
/**< Ritorno la versione del Server che sto utilizzando */ /**< Ritorno la versione del Server che sto utilizzando */
const char* getServerV(); const char* get_server_v() const;
/**< Ritorno la versione del Server che sto utilizzando in formato numerico */ /**< Ritorno la versione del Server che sto utilizzando in formato numerico */
long get_server_vn(); long get_server_vn() const;
/**< Ritorno se il recordset è carico */ /**< Ritorno se il recordset è carico */
bool is_loaded() const; bool is_loaded() const;
/**< Ritorno il numero di elementi nella query */ /**< Ritorno il numero di elementi nella query */
@ -164,7 +164,7 @@ public:
/**< Imposta la query ricevuta nel recordset */ /**< Imposta la query ricevuta nel recordset */
bool set(const char* query); bool set(const char* query);
/**< Esegue la query impostata nel recordset, se viene passato autoF == true esegue anche un comando Next() */ /**< Esegue la query impostata nel recordset, se viene passato autoF == true esegue anche un comando Next() */
bool exec(bool autoF = true); bool exec(bool auto_f = true);
/**< Unisce le funzioni Set e Exec, riceve la query */ /**< Unisce le funzioni Set e Exec, riceve la query */
bool set_exec(const char* query, bool auto_f = true); bool set_exec(const char* query, bool auto_f = true);
/**< Si sposta avanti di un record, in caso di esito negativo valorizza _stringError e _codeError */ /**< Si sposta avanti di un record, in caso di esito negativo valorizza _stringError e _codeError */

View File

@ -5,3 +5,6 @@
#define NOT_INITIALIZEDS "ERROR: Recordset not initialized" #define NOT_INITIALIZEDS "ERROR: Recordset not initialized"
#define ERROR_FREEZED -883 #define ERROR_FREEZED -883
#define ERROR_FREEZEDS "ERROR: Recordset on ice" #define ERROR_FREEZEDS "ERROR: Recordset on ice"
#define DEFAULT_ERR_NUMBER -19
#define DEFAULT_ERR_STRING ""
#define DEFAULT_ERR_CHAR '\0'