MAK Data Logger API Documentation for HLA
Home
Modules
Namespaces
Classes
Files
Examples
Libraries
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
include
vlDatabase
sqlIfError.h
Go to the documentation of this file.
1
/*******************************************************************************
2
** Copyright (c) 1992-2010 VT MAK
3
** All rights reserved.
4
*******************************************************************************/
5
8
9
#pragma once
10
11
#include "
vlDatabase.h
"
12
13
#ifdef _WIN32
14
#include <windows.h>
15
#include <sqltypes.h>
16
#include <odbcinst.h>
17
#else
18
#include <sqltypes.h>
19
#ifndef __rhentws8__
20
#include <iodbcinst.h>
21
#else
22
#include <odbcinst.h>
23
#include <sql.h>
24
#include <sqltypes.h>
25
#endif
26
#endif
27
#if !defined(_INC_STDIO) && !defined(_STDIO_H)
28
#include <stdio.h>
29
#endif
30
31
32
//
33
// class DtSqlIfErrorHandler:
34
//
35
// Since the process for getting error information from the ODBC driver is
36
// somewhat circuitous, this class encapsulates the necessary calls, and writes
37
// any error messages to the log file provided. It checks the return code
38
// provided, so processReturnCode may be called immediately after any ODBC
39
// interface call without checking the returned error code first.
40
//
41
class
DT_DLL_VLDB
DtSqlIfErrorHandler
42
{
43
public
:
44
// Default constructor
45
DtSqlIfErrorHandler
();
46
47
// Destructor
48
virtual
~
DtSqlIfErrorHandler
();
49
50
// process the return code from an ODBC interface call
51
virtual
void
processRetCode(
52
SQLRETURN retCode, SQLSMALLINT handle_type, SQLHANDLE handle );
53
54
static
bool
SqlSuccess(SQLRETURN rc);
55
};
56
57
inline
bool
DtSqlIfErrorHandler::SqlSuccess
(SQLRETURN rc)
58
{
59
return
( (rc == SQL_SUCCESS) || (rc == SQL_SUCCESS_WITH_INFO) );
60
}
Document ID: Generated on Thu Jul 23 15:05:27 EDT 2020 from SVN revision 215371
Copyright © 2020 MAK Technologies. All Rights Reserved (
www.mak.com
)