List:Commits« Previous MessageNext Message »
From:pharvey Date:January 8 2006 8:03pm
Subject:Connector/ODBC 5 commit: r36 - in MYODBCDia: MYODBCDiaLib include
View as plain text  
Added:
   MYODBCDia/include/MYODBCDiaState.h
Modified:
   MYODBCDia/MYODBCDiaLib/MYODBCDia.cpp
   MYODBCDia/MYODBCDiaLib/MYODBCDiaInternal.h
   MYODBCDia/MYODBCDiaLib/MYODBCDiaLib.pro
   MYODBCDia/MYODBCDiaLib/MYODBCDiaRec.cpp
   MYODBCDia/MYODBCDiaLib/MYODBCDiaRec.h
Log:
UNICODE:
- revised diagnostic code now clean compiles

Modified: MYODBCDia/MYODBCDiaLib/MYODBCDia.cpp
===================================================================
--- MYODBCDia/MYODBCDiaLib/MYODBCDia.cpp	2006-01-08 07:43:04 UTC (rev 35)
+++ MYODBCDia/MYODBCDiaLib/MYODBCDia.cpp	2006-01-08 20:03:55 UTC (rev 36)
@@ -119,7 +119,7 @@
 
     if ( nRecNumber < 1 )
         MYODBCDbgReturn( SQL_ERROR );
-    if ( nRecNumber >= getNumber(); )
+    if ( nRecNumber >= getNumber() )
         MYODBCDbgReturn( SQL_NO_DATA );
 
     MYODBCDbgReturn( listRecords[nRecNumber]->getDiagRec( psSqlstate,
pnNativeErrorPtr, pszMessageText, nBufferLength, pnTextLengthPtr ) );
@@ -196,7 +196,7 @@
         default:
             if ( nRecNumber < 1 )
                 MYODBCDbgReturn( SQL_ERROR );
-            if ( nRecNumber >= getNumber(); )
+            if ( nRecNumber >= getNumber() )
                 MYODBCDbgReturn( SQL_NO_DATA );
             MYODBCDbgReturn( listRecords[nRecNumber]->getDiagField( nDiagIdentifier,
pDiagInfoPtr, nBufferLength, pnStringLengthPtr ) );
     }
@@ -219,68 +219,68 @@
     switch ( nDynamicFunctionCode )
     {
         case SQL_DIAG_ALTER_DOMAIN:
-            MYODBCDbgReturn( "ALTER DOMAIN" );
+            MYODBCDbgReturn3( "%s", "ALTER DOMAIN" );
         case SQL_DIAG_ALTER_TABLE:
-            MYODBCDbgReturn( "ALTER TABLE" );
+            MYODBCDbgReturn3( "%s", "ALTER TABLE" );
         case SQL_DIAG_CALL:
-            MYODBCDbgReturn( "CALL" );
+            MYODBCDbgReturn3( "%s", "CALL" );
         case SQL_DIAG_CREATE_ASSERTION:
-            MYODBCDbgReturn( "CREATE ASSERTION" );
+            MYODBCDbgReturn3( "%s", "CREATE ASSERTION" );
         case SQL_DIAG_CREATE_CHARACTER_SET:
-            MYODBCDbgReturn( "CREATE CHARACTER SET)" );
+            MYODBCDbgReturn3( "%s", "CREATE CHARACTER SET)" );
         case SQL_DIAG_CREATE_COLLATION:
-            MYODBCDbgReturn( "CREATE COLLATION" );
+            MYODBCDbgReturn3( "%s", "CREATE COLLATION" );
         case SQL_DIAG_CREATE_DOMAIN:
-            MYODBCDbgReturn( "CREATE DOMAIN" );
+            MYODBCDbgReturn3( "%s", "CREATE DOMAIN" );
         case SQL_DIAG_CREATE_INDEX:
-            MYODBCDbgReturn( "CREATE INDEX" );
+            MYODBCDbgReturn3( "%s", "CREATE INDEX" );
         case SQL_DIAG_CREATE_SCHEMA:
-            MYODBCDbgReturn( "CREATE SCHEMA" );
+            MYODBCDbgReturn3( "%s", "CREATE SCHEMA" );
         case SQL_DIAG_CREATE_TABLE:
-            MYODBCDbgReturn( "CREATE TABLE" );
+            MYODBCDbgReturn3( "%s", "CREATE TABLE" );
         case SQL_DIAG_CREATE_TRANSLATION:
-            MYODBCDbgReturn( "CREATE TRANSLATION" );
+            MYODBCDbgReturn3( "%s", "CREATE TRANSLATION" );
         case SQL_DIAG_CREATE_VIEW:
-            MYODBCDbgReturn( "CREATE VIEW" );
+            MYODBCDbgReturn3( "%s", "CREATE VIEW" );
         case SQL_DIAG_DELETE_WHERE:
-            MYODBCDbgReturn( "DELETE WHERE" );
+            MYODBCDbgReturn3( "%s", "DELETE WHERE" );
         case SQL_DIAG_DROP_ASSERTION:
-            MYODBCDbgReturn( "DROP ASSERTION" );
+            MYODBCDbgReturn3( "%s", "DROP ASSERTION" );
         case SQL_DIAG_DROP_CHARACTER_SET:
-            MYODBCDbgReturn( "DROP CHARACTER SET" );
+            MYODBCDbgReturn3( "%s", "DROP CHARACTER SET" );
         case SQL_DIAG_DROP_COLLATION:
-            MYODBCDbgReturn( "DROP COLLATION" );
+            MYODBCDbgReturn3( "%s", "DROP COLLATION" );
         case SQL_DIAG_DROP_DOMAIN:
-            MYODBCDbgReturn( "DROP DOMAIN" );
+            MYODBCDbgReturn3( "%s", "DROP DOMAIN" );
         case SQL_DIAG_DROP_INDEX:
-            MYODBCDbgReturn( "DROP INDEX" );
+            MYODBCDbgReturn3( "%s", "DROP INDEX" );
         case SQL_DIAG_DROP_SCHEMA:
-            MYODBCDbgReturn( "DROP SCHEMA" );
+            MYODBCDbgReturn3( "%s", "DROP SCHEMA" );
         case SQL_DIAG_DROP_TABLE:
-            MYODBCDbgReturn( "DROP TABLE" );
+            MYODBCDbgReturn3( "%s", "DROP TABLE" );
         case SQL_DIAG_DROP_TRANSLATION:
-            MYODBCDbgReturn( "DROP TRANSLATION" );
+            MYODBCDbgReturn3( "%s", "DROP TRANSLATION" );
         case SQL_DIAG_DROP_VIEW:
-            MYODBCDbgReturn( "DROP VIEW" );
+            MYODBCDbgReturn3( "%s", "DROP VIEW" );
         case SQL_DIAG_DYNAMIC_DELETE_CURSOR:
-            MYODBCDbgReturn( "DYNAMIC DELETE CURSOR" );
+            MYODBCDbgReturn3( "%s", "DYNAMIC DELETE CURSOR" );
         case SQL_DIAG_DYNAMIC_UPDATE_CURSOR:
-            MYODBCDbgReturn( "DYNAMIC UPDATE CURSOR" );
+            MYODBCDbgReturn3( "%s", "DYNAMIC UPDATE CURSOR" );
         case SQL_DIAG_GRANT:
-            MYODBCDbgReturn( "GRANT" );
+            MYODBCDbgReturn3( "%s", "GRANT" );
         case SQL_DIAG_INSERT:
-            MYODBCDbgReturn( "INSERT" );
+            MYODBCDbgReturn3( "%s", "INSERT" );
         case SQL_DIAG_REVOKE:
-            MYODBCDbgReturn( "REVOKE" );
+            MYODBCDbgReturn3( "%s", "REVOKE" );
         case SQL_DIAG_SELECT_CURSOR:
-            MYODBCDbgReturn( "SELECT CURSOR" );
+            MYODBCDbgReturn3( "%s", "SELECT CURSOR" );
         case SQL_DIAG_UPDATE_WHERE:
-            MYODBCDbgReturn( "UPDATE_WHERE" );
+            MYODBCDbgReturn3( "%s", "UPDATE_WHERE" );
 /*        case SQL_DIAG_UNKNOWN_STATEMENT:
             return "UNKNOWN_STATEMENT"; */
     }
 
-    MYODBCDbgReturn( "UNKNOWN_STATEMENT" );
+    MYODBCDbgReturn3( "%s", "UNKNOWN_STATEMENT" );
 }
 
 SQLINTEGER MYODBCDia::getDynamicFunctionCode()

Modified: MYODBCDia/MYODBCDiaLib/MYODBCDiaInternal.h
===================================================================
--- MYODBCDia/MYODBCDiaLib/MYODBCDiaInternal.h	2006-01-08 07:43:04 UTC (rev 35)
+++ MYODBCDia/MYODBCDiaLib/MYODBCDiaInternal.h	2006-01-08 20:03:55 UTC (rev 36)
@@ -33,6 +33,7 @@
 #define MYODBC_DIA_INTERNAL_H
 
 #include "../include/MYODBCDia.h"
+#include "MYODBCDiaRec.h"
 
 #endif
 

Modified: MYODBCDia/MYODBCDiaLib/MYODBCDiaLib.pro
===================================================================
--- MYODBCDia/MYODBCDiaLib/MYODBCDiaLib.pro	2006-01-08 07:43:04 UTC (rev 35)
+++ MYODBCDia/MYODBCDiaLib/MYODBCDiaLib.pro	2006-01-08 20:03:55 UTC (rev 36)
@@ -35,7 +35,8 @@
 # #########################################################
 HEADERS		= \
 		../include/MYODBCDia.h \
-		../include/MYODBCDiaRec.h \
+		../include/MYODBCDiaState.h \
+		MYODBCDiaRec.h \
 		MYODBCDiaInternal.h
 
 SOURCES		= \

Modified: MYODBCDia/MYODBCDiaLib/MYODBCDiaRec.cpp
===================================================================
--- MYODBCDia/MYODBCDiaLib/MYODBCDiaRec.cpp	2006-01-08 07:43:04 UTC (rev 35)
+++ MYODBCDia/MYODBCDiaLib/MYODBCDiaRec.cpp	2006-01-08 20:03:55 UTC (rev 36)
@@ -1,5 +1,7 @@
 #include "MYODBCDiaInternal.h"
 
+#include <QString>
+
 /*!
     \internal
     \brief  This is a static table of all SQL state information.
@@ -198,7 +200,7 @@
 
     this->nColumnNumber = nColumnNumber;
 
-    MYODBCDDbgReturn( SQL_SUCCESS );
+    MYODBCDbgReturn( SQL_SUCCESS );
 }
 
 SQLRETURN MYODBCDiaRec::setMessage( const QString &stringMessage )
@@ -207,7 +209,7 @@
 
     this->stringMessage = stringMessage;
 
-    MYODBCDDbgReturn( SQL_SUCCESS );
+    MYODBCDbgReturn( SQL_SUCCESS );
 }
 
 SQLRETURN MYODBCDiaRec::setNative( SQLINTEGER nNative )
@@ -216,7 +218,7 @@
 
     this->nNative = nNative;
 
-    MYODBCDDbgReturn( SQL_SUCCESS );
+    MYODBCDbgReturn( SQL_SUCCESS );
 }
 
 SQLRETURN MYODBCDiaRec::setRowNumber( SQLINTEGER nRowNumber )
@@ -225,15 +227,41 @@
 
     this->nRowNumber = nRowNumber;
 
-    MYODBCDDbgReturn( SQL_SUCCESS );
+    MYODBCDbgReturn( SQL_SUCCESS );
 }
 
 
 SQLRETURN MYODBCDiaRec::getDiagRec( SQLWCHAR *psSqlstate, SQLINTEGER *pnNativeErrorPtr,
SQLWCHAR *pszMessageText, SQLSMALLINT nBufferLength, SQLSMALLINT *pnTextLengthPtr )
 {
+    SQLRETURN   nReturn;
+    bool        bHasInfo = false;
+    SQLSMALLINT nStringLength;
+
     MYODBCDbgEnter();
 
-    MYODBCDDbgReturn( SQL_SUCCESS );
+    nReturn = getDiagField( SQL_DIAG_SQLSTATE, psSqlstate, 5, &nStringLength );
+    if ( nReturn == SQL_SUCCESS_WITH_INFO )
+        bHasInfo = true;
+    if ( !SQL_SUCCEEDED( nReturn ) )
+        MYODBCDbgReturn( nReturn );
+
+    nReturn = getDiagField( SQL_DIAG_NATIVE, pnNativeErrorPtr, SQL_IS_INTEGER, NULL );
+    if ( nReturn == SQL_SUCCESS_WITH_INFO )
+        bHasInfo = true;
+    if ( !SQL_SUCCEEDED( nReturn ) )
+        MYODBCDbgReturn( nReturn );
+
+    nReturn = getDiagField( SQL_DIAG_SQLSTATE, pszMessageText, nBufferLength,
&nStringLength );
+    if ( pnTextLengthPtr ) *pnTextLengthPtr = nStringLength;
+    if ( nReturn == SQL_SUCCESS_WITH_INFO )
+        bHasInfo = true;
+    if ( !SQL_SUCCEEDED( nReturn ) )
+        MYODBCDbgReturn( nReturn );
+
+    if ( bHasInfo )
+        MYODBCDbgReturn( SQL_SUCCESS_WITH_INFO );
+
+    MYODBCDbgReturn( SQL_SUCCESS );
 }
 
 SQLRETURN MYODBCDiaRec::getDiagField( SQLSMALLINT nDiagIdentifier, SQLPOINTER
pDiagInfoPtr, SQLSMALLINT nBufferLength, SQLSMALLINT *pnStringLengthPtr )
@@ -349,7 +377,7 @@
             MYODBCDbgReturn( SQL_ERROR );
     }
 
-    MYODBCDDbgReturn( SQL_SUCCESS );
+    MYODBCDbgReturn( SQL_SUCCESS );
 }
 
 
@@ -357,21 +385,21 @@
 {
     MYODBCDbgEnter();
 
-    MYODBCDbgReturn( MYODBCDia_pStates[nState].diag_class_origin );
+    MYODBCDbgReturn3( "%s", MYODBCDia_pStates[nState].diag_class_origin );
 }
 
 SQLINTEGER MYODBCDiaRec::getColumnNumber()
 {
     MYODBCDbgEnter();
 
-    MYODBCDbgReturn( nColumnNumber );
+    MYODBCDbgReturn3( "%d", nColumnNumber );
 }
 
 QString MYODBCDiaRec::getConnectionName()
 {
     MYODBCDbgEnter();
 
-    MYODBCDbgReturn( stringConnectionName );
+    MYODBCDbgReturn3( "%s", stringConnectionName );
 }
 
 QString MYODBCDiaRec::getMessageText()
@@ -383,77 +411,81 @@
     {
         /* server message */
         if ( stringMessage.isEmpty() )
-            MYODBCDbgReturn( QString( "[%1][%2 %3][%4] %5 %6" )
-                             .arg( MYODBC_VENDOR )
-                             .arg( MYODBC_NAME )
-                             .arg( MYODBC_DRIVER_VER )
-                             .arg( MYODBC_VENDOR )
-                             .arg( nNative )
-                             .arg( MYODBCDia_pStates[nState].diag_text ) );
+        {
+            MYODBCDbgReturn3( "%s", (QString( "[%1][%2 %3][%4] %5 %6" )
+                                    .arg( MYODBC_VENDOR )
+                                    .arg( MYODBC_NAME )
+                                    .arg( MYODBC_DRIVER_VER )
+                                    .arg( MYODBC_VENDOR )
+                                    .arg( nNative )
+                                    .arg( MYODBCDia_pStates[nState].diag_text )) );
+        }
         else
-            MYODBCDbgReturn( QString( "[%1][%2 %3][%4] %5 %6" )
-                             .arg( MYODBC_VENDOR )
-                             .arg( MYODBC_NAME )
-                             .arg( MYODBC_DRIVER_VER )
-                             .arg( MYODBC_VENDOR )
-                             .arg( nNative )
-                             .arg( stringMessage ) );
+            MYODBCDbgReturn3( "%s", (QString( "[%1][%2 %3][%4] %5 %6" )
+                                    .arg( MYODBC_VENDOR )
+                                    .arg( MYODBC_NAME )
+                                    .arg( MYODBC_DRIVER_VER )
+                                    .arg( MYODBC_VENDOR )
+                                    .arg( nNative )
+                                    .arg( stringMessage )) );
     }
     else
     {
         /* driver message */
         if ( stringMessage.isEmpty() )
-            MYODBCDbgReturn( QString( "[%1][%2 %3][%4] %5" )
-                             .arg( MYODBC_VENDOR )
-                             .arg( MYODBC_NAME )
-                             .arg( MYODBC_DRIVER_VER )
-                             .arg( MYODBCDia_pStates[nState].diag_sqlstate )
-                             .arg( MYODBCDia_pStates[nState].diag_text ) );
+        {
+            MYODBCDbgReturn3( "%s", QString( "[%1][%2 %3][%4] %5" )
+                                    .arg( MYODBC_VENDOR )
+                                    .arg( MYODBC_NAME )
+                                    .arg( MYODBC_DRIVER_VER )
+                                    .arg( MYODBCDia_pStates[nState].diag_sqlstate )
+                                    .arg( MYODBCDia_pStates[nState].diag_text ) );
+        }
         else
-            MYODBCDbgReturn( QString( "[%1][%2 %3][%4] %5" )
-                             .arg( MYODBC_VENDOR )
-                             .arg( MYODBC_NAME )
-                             .arg( MYODBC_DRIVER_VER )
-                             .arg( MYODBCDia_pStates[nState].diag_sqlstate )
-                             .arg( stringMessage ) );
+            MYODBCDbgReturn3( "%s", QString( "[%1][%2 %3][%4] %5" )
+                                    .arg( MYODBC_VENDOR )
+                                    .arg( MYODBC_NAME )
+                                    .arg( MYODBC_DRIVER_VER )
+                                    .arg( MYODBCDia_pStates[nState].diag_sqlstate )
+                                    .arg( stringMessage ) );
     }
 
-    MYODBCDbgReturn( stringMessage );
+    MYODBCDbgReturn3( "%s", stringMessage );
 }
 
 QString MYODBCDiaRec::getMessage()
 {
     MYODBCDbgEnter();
 
-    MYODBCDbgReturn( stringMessage );
+    MYODBCDbgReturn3( "%s", stringMessage );
 }
 
 SQLINTEGER MYODBCDiaRec::getNative()
 {
     MYODBCDbgEnter();
 
-    MYODBCDbgReturn( nNative );
+    MYODBCDbgReturn3( "%d", nNative );
 }
 
 SQLINTEGER MYODBCDiaRec::getRowNumber()
 {
     MYODBCDbgEnter();
 
-    MYODBCDbgReturn( nRowNumber );
+    MYODBCDbgReturn3( "%d", nRowNumber );
 }
 
 QString MYODBCDiaRec::getServerName()
 {
     MYODBCDbgEnter();
 
-    MYODBCDbgReturn( stringServerName );
+    MYODBCDbgReturn3( "%s", stringServerName );
 }
 
 QString MYODBCDiaRec::getSQLState()
 {
     MYODBCDbgEnter();
 
-    MYODBCDbgReturn( MYODBCDia_pStates[nState].diag_sqlstate );
+    MYODBCDbgReturn3( "%s", MYODBCDia_pStates[nState].diag_sqlstate );
 }
 
 
@@ -461,7 +493,7 @@
 {
     MYODBCDbgEnter();
 
-    MYODBCDbgReturn( MYODBCDia_pStates[nState].diag_class_origin );
+    MYODBCDbgReturn3( "%s", MYODBCDia_pStates[nState].diag_class_origin );
 }
 
 MYODBCDia *MYODBCDiaRec::getDia()

Modified: MYODBCDia/MYODBCDiaLib/MYODBCDiaRec.h
===================================================================
--- MYODBCDia/MYODBCDiaLib/MYODBCDiaRec.h	2006-01-08 07:43:04 UTC (rev 35)
+++ MYODBCDia/MYODBCDiaLib/MYODBCDiaRec.h	2006-01-08 20:03:55 UTC (rev 36)
@@ -1,7 +1,7 @@
 #ifndef MYODBC_DIA_RECORD_H
 #define MYODBC_DIA_RECORD_H
 
-#include "MYODBCDiaInternal.h"
+#include "../include/MYODBCDiaState.h"
 
 /*!
     \brief This is a diagnostic record.

Added: MYODBCDia/include/MYODBCDiaState.h
===================================================================
--- MYODBCDia/include/MYODBCDiaState.h	2006-01-08 07:43:04 UTC (rev 35)
+++ MYODBCDia/include/MYODBCDiaState.h	2006-01-08 20:03:55 UTC (rev 36)
@@ -0,0 +1,178 @@
+#ifndef MYODBC_DIA_STATE_H
+#define MYODBC_DIA_STATE_H
+
+#include <MYODBCC.h>
+#include <QString>
+
+/*!
+    \brief These are the numeric constants used to indicated SQL states.
+  
+    ODBC Error Codes
+   
+    SQLGetDiagRec or SQLGetDiagField returns SQLSTATE values as defined by 
+    X/Open Data Management: Structured Query Language (SQL), Version 2 
+    (March 1995). SQLSTATE values are strings that contain five characters. 
+    The following lists SQLSTATE values that a driver can return for 
+    SQLGetDiagRec.
+
+    The character string value returned for an SQLSTATE consists of a 
+    two-character class value followed by a three-character subclass value. 
+    A class value of "01" indicates a warning and is accompanied by a return 
+    code of SQL_SUCCESS_WITH_INFO. Class values other than "01," except 
+    for the class "IM," indicate an error and are accompanied by a return 
+    value of SQL_ERROR. The class "IM" is specific to warnings and errors 
+    that derive from the implementation of ODBC itself. The subclass value 
+    "000" in any class indicates that there is no subclass for that SQLSTATE. 
+    The assignment of class and subclass values is defined by SQL-92.
+    
+    \sa MYODBCDia_pStates MYODBC_DIA_STATE
+*/    
+typedef enum MYODBC_DIA_ID
+{
+    MYODBC_DIA_01000=0,/* General warning                                                
 */
+    MYODBC_DIA_01001,  /* Cursor operation conflict                                      
 */
+    MYODBC_DIA_01002,  /* Disconnect error                                               
 */
+    MYODBC_DIA_01003,  /* NULL value eliminated in set function                          
 */
+    MYODBC_DIA_01004,  /* String data, right-truncated                                   
 */
+    MYODBC_DIA_01006,  /* Privilege not revoked                                          
 */
+    MYODBC_DIA_01007,  /* Privilege not granted                                          
 */
+    MYODBC_DIA_01S00,  /* Invalid connection string attribute                            
 */
+    MYODBC_DIA_01S01,  /* Error in row                                                   
 */
+    MYODBC_DIA_01S02,  /* Option value changed                                           
 */
+    MYODBC_DIA_01S06,  /* Attempt to fetch before the result set returned the first
rowset */
+    MYODBC_DIA_01S07,  /* Fractional truncation                                          
 */
+    MYODBC_DIA_01S08,  /* Error saving File DSN                                          
 */
+    MYODBC_DIA_01S09,  /* Invalid keyword                                                
 */
+    MYODBC_DIA_07001,  /* Wrong number of parameters                                     
 */
+    MYODBC_DIA_07002,  /* COUNT field incorrect                                          
 */
+    MYODBC_DIA_07005,  /* Prepared statement not a cursor-specification                  
 */
+    MYODBC_DIA_07006,  /* Restricted data type attribute violation                       
 */
+    MYODBC_DIA_07009,  /* Invalid descriptor index                                       
 */
+    MYODBC_DIA_07S01,  /* Invalid use of default parameter                               
 */
+    MYODBC_DIA_08001,  /* Client unable to establish connection                          
 */
+    MYODBC_DIA_08002,  /* Connection name in use                                         
 */
+    MYODBC_DIA_08003,  /* Connection does not exist                                      
 */
+    MYODBC_DIA_08004,  /* Server rejected the connection                                 
 */
+    MYODBC_DIA_08007,  /* Connection failure during transaction                          
 */
+    MYODBC_DIA_08S01,  /* Communication link failure                                     
 */
+    MYODBC_DIA_21S01,  /* Insert value list does not match column list                   
 */
+    MYODBC_DIA_21S02,  /* Degree of derived table does not match column list             
 */
+    MYODBC_DIA_22001,  /* String data, right-truncated                                   
 */
+    MYODBC_DIA_22002,  /* Indicator variable required but not supplied                   
 */
+    MYODBC_DIA_22003,  /* Numeric value out of range                                     
 */
+    MYODBC_DIA_22007,  /* Invalid datetime format                                        
 */
+    MYODBC_DIA_22008,  /* Datetime field overflow                                        
 */
+    MYODBC_DIA_22012,  /* Division by zero                                               
 */
+    MYODBC_DIA_22015,  /* Interval field overflow                                        
 */
+    MYODBC_DIA_22018,  /* Invalid character value for cast specification                 
 */
+    MYODBC_DIA_22019,  /* Invalid escape character                                       
 */
+    MYODBC_DIA_22025,  /* Invalid escape sequence                                        
 */
+    MYODBC_DIA_22026,  /* String data, length mismatch                                   
 */
+    MYODBC_DIA_23000,  /* Integrity constraint violation                                 
 */
+    MYODBC_DIA_24000,  /* Invalid cursor state                                           
 */
+    MYODBC_DIA_25000,  /* Invalid transaction state                                      
 */
+    MYODBC_DIA_25S01,  /* Transaction state                                              
 */
+    MYODBC_DIA_25S02,  /* Transaction is still active                                    
 */
+    MYODBC_DIA_25S03,  /* Transaction is rolled back                                     
 */
+    MYODBC_DIA_28000,  /* Invalid authorization specification                            
 */
+    MYODBC_DIA_34000,  /* Invalid cursor name                                            
 */
+    MYODBC_DIA_3C000,  /* Duplicate cursor name                                          
 */
+    MYODBC_DIA_3D000,  /* Invalid catalog name                                           
 */
+    MYODBC_DIA_3F000,  /* Invalid schema name                                            
 */
+    MYODBC_DIA_40001,  /* Serialization failure                                          
 */
+    MYODBC_DIA_40002,  /* Integrity constraint violation                                 
 */
+    MYODBC_DIA_40003,  /* Statement completion unknown                                   
 */
+    MYODBC_DIA_42000,  /* Syntax error or access violation                               
 */
+    MYODBC_DIA_42S01,  /* Base table or view already exists                              
 */
+    MYODBC_DIA_42S02,  /* Base table or view not found                                   
 */
+    MYODBC_DIA_42S11,  /* Index already exists                                           
 */
+    MYODBC_DIA_42S12,  /* Index not found                                                
 */
+    MYODBC_DIA_42S21,  /* Column already exists                                          
 */
+    MYODBC_DIA_42S22,  /* Column not found                                               
 */
+    MYODBC_DIA_44000,  /* WITH CHECK OPTION violation                                    
 */
+    MYODBC_DIA_HY000,  /* General error                                                  
 */
+    MYODBC_DIA_HY001,  /* Memory allocation error                                        
 */
+    MYODBC_DIA_HY003,  /* Invalid application buffer type                                
 */
+    MYODBC_DIA_HY004,  /* Invalid SQL data type                                          
 */
+    MYODBC_DIA_HY007,  /* Associated statement is not prepared                           
 */
+    MYODBC_DIA_HY008,  /* Operation canceled                                             
 */
+    MYODBC_DIA_HY009,  /* Invalid use of null pointer                                    
 */
+    MYODBC_DIA_HY010,  /* Function sequence error                                        
 */
+    MYODBC_DIA_HY011,  /* Attribute cannot be set now                                    
 */
+    MYODBC_DIA_HY012,  /* Invalid transaction operation code                             
 */
+    MYODBC_DIA_HY013,  /* Memory management error                                        
 */
+    MYODBC_DIA_HY014,  /* Limit on the number of handles exceeded                        
 */
+    MYODBC_DIA_HY015,  /* No cursor name available                                       
 */
+    MYODBC_DIA_HY016,  /* Cannot modify an implementation row descriptor                 
 */
+    MYODBC_DIA_HY017,  /* Invalid use of an automatically allocated descriptor handle    
 */
+    MYODBC_DIA_HY018,  /* Server declined cancel request                                 
 */
+    MYODBC_DIA_HY019,  /* Non-character and non-binary data sent in pieces               
 */
+    MYODBC_DIA_HY020,  /* Attempt to concatenate a null value                            
 */
+    MYODBC_DIA_HY021,  /* Inconsistent descriptor information                            
 */
+    MYODBC_DIA_HY024,  /* Invalid attribute value                                        
 */
+    MYODBC_DIA_HY090,  /* Invalid string or buffer length                                
 */
+    MYODBC_DIA_HY091,  /* Invalid descriptor field identifier                            
 */
+    MYODBC_DIA_HY092,  /* Invalid attribute/option identifier                            
 */
+    MYODBC_DIA_HY095,  /* Function type out of range                                     
 */
+    MYODBC_DIA_HY096,  /* Invalid information type                                       
 */
+    MYODBC_DIA_HY097,  /* Column type out of range                                       
 */
+    MYODBC_DIA_HY098,  /* Scope type out of range                                        
 */
+    MYODBC_DIA_HY099,  /* Nullable type out of range                                     
 */
+    MYODBC_DIA_HY100,  /* Uniqueness option type out of range                            
 */
+    MYODBC_DIA_HY101,  /* Accuracy option type out of range                              
 */
+    MYODBC_DIA_HY103,  /* Invalid retrieval code                                         
 */
+    MYODBC_DIA_HY104,  /* Invalid precision or scale value                               
 */
+    MYODBC_DIA_HY105,  /* Invalid parameter type                                         
 */
+    MYODBC_DIA_HY106,  /* Fetch type out of range                                        
 */
+    MYODBC_DIA_HY107,  /* Row value out of range                                         
 */
+    MYODBC_DIA_HY109,  /* Invalid cursor position                                        
 */
+    MYODBC_DIA_HY110,  /* Invalid driver completion                                      
 */
+    MYODBC_DIA_HY111,  /* Invalid bookmark value                                         
 */
+    MYODBC_DIA_HYC00,  /* Optional feature not implemented                               
 */
+    MYODBC_DIA_HYT00,  /* Timeout expired                                                
 */
+    MYODBC_DIA_HYT01,  /* Connection timeout expired                                     
 */
+    MYODBC_DIA_IM001,  /* Driver does not support this function                          
 */
+    MYODBC_DIA_IM002,  /* Data source name not found and no default driver specified     
 */
+    MYODBC_DIA_IM003,  /* Specified driver could not be loaded                           
 */
+    MYODBC_DIA_IM004,  /* Driver's SQLAllocHandle on SQL_HANDLE_ENV failed               
 */
+    MYODBC_DIA_IM005,  /* Driver's SQLAllocHandle on SQL_HANDLE_DBC failed               
 */
+    MYODBC_DIA_IM006,  /* Driver's SQLSetConnectAttr failed                              
 */
+    MYODBC_DIA_IM007,  /* No data source or driver specified; dialog prohibited          
 */
+    MYODBC_DIA_IM008,  /* Dialog failed                                                  
 */
+    MYODBC_DIA_IM009,  /* Unable to load translation DLL                                 
 */
+    MYODBC_DIA_IM010,  /* Data source name too long                                      
 */
+    MYODBC_DIA_IM011,  /* Driver name too long                                           
 */
+    MYODBC_DIA_IM012,  /* DRIVER keyword syntax error                                    
 */
+    MYODBC_DIA_IM013,  /* Trace file error                                               
 */
+    MYODBC_DIA_IM014,  /* Invalid name of File DSN                                       
 */
+    MYODBC_DIA_IM015,  /* Corrupt file data source                                       
 */
+    MYODBC_DIA_MAX
+
+} MYODBC_DIA_ID;
+
+/*!
+    \internal
+    \brief  This is used to generate a static 'table' of all state
+            information and corresponds to numeric state values.
+    
+            The static 'table' of state information generated using this
+            is found in MYODBCDiaAlloc.c as MYODBCDia_pStates. The state 
+            information is then referenced/indexed using MYODBC_DIA_ID.
+    
+    \sa     MYODBC_DIA_ID 
+            MYODBCDia_pStates
+*/
+typedef struct tMYODBC_DIA_STATE
+{
+  QString   diag_class_origin;
+  QString   diag_sqlstate;
+  QString   diag_class;
+  QString   diag_text;
+  SQLRETURN diag_returncode;
+
+} MYODBC_DIA_STATE;
+
+extern MYODBC_DIA_STATE MYODBCDia_pStates[];
+
+#endif
+

Thread
Connector/ODBC 5 commit: r36 - in MYODBCDia: MYODBCDiaLib includepharvey8 Jan