MAK Data Logger API Documentation for HLA
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
sqlIfError.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 1992-2025 MAK Technologies, Inc
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  #include <sql.h>
18  #include <sqlext.h>
19 #else
20  #include <sqltypes.h>
21  #include <sql.h>
22  #include <sqlext.h>
23  #if !defined(__rhentws8__) && !defined(__rhentws9__)
24  #include <iodbcinst.h>
25  #else
26  #include <odbcinst.h>
27  #endif
28 #endif
29 
30 #if !defined(_INC_STDIO) && !defined(_STDIO_H)
31  #include <stdio.h>
32 #endif
33 
34 
35 //
36 // class DtSqlIfErrorHandler:
37 //
38 // Since the process for getting error information from the ODBC driver is
39 // somewhat circuitous, this class encapsulates the necessary calls, and writes
40 // any error messages to the log file provided. It checks the return code
41 // provided, so processReturnCode may be called immediately after any ODBC
42 // interface call without checking the returned error code first.
43 //
45 {
46 public:
47  // Default constructor
49 
50  // Destructor
51  virtual ~DtSqlIfErrorHandler();
52 
53  // process the return code from an ODBC interface call
54  virtual void processRetCode(
55  SQLRETURN retCode, SQLSMALLINT handle_type, SQLHANDLE handle );
56 
57  static bool SqlSuccess(SQLRETURN rc);
58 };
59 
60 inline bool DtSqlIfErrorHandler::SqlSuccess(SQLRETURN rc)
61 {
62  return ( (rc == SQL_SUCCESS) || (rc == SQL_SUCCESS_WITH_INFO) );
63 }
Contains DLL macros.
static bool SqlSuccess(SQLRETURN rc)
Definition: sqlIfError.h:60
Definition: sqlIfError.h:44
#define DT_DLL_VLDB
Definition: vlDatabase.h:20

Document ID: Generated on Thu Dec 18 15:35:09 EST 2025 from SVN revision 282494
Copyright © 2024 MAK Technologies. All Rights Reserved (www.mak.com)