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-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 //
42 {
43 public:
44  // Default constructor
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 }
Contains DLL macros.
static bool SqlSuccess(SQLRETURN rc)
Definition: sqlIfError.h:57
Definition: sqlIfError.h:41
#define DT_DLL_VLDB
Definition: vlDatabase.h:20

Document ID: Generated on Mon Mar 22 15:30:17 EDT 2021 from SVN revision 226440
Copyright © 2021 MAK Technologies. All Rights Reserved (www.mak.com)