Changeset 70fd0e0 in tol
- Timestamp:
- Feb 15, 2011, 10:43:05 AM (16 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 978b431
- Parents:
- b7e6cec
- Location:
- tol/dbdrivers
- Files:
-
- 3 added
- 2 edited
-
Jamfile (modified) (1 diff)
-
libtolodbc.c (modified) (4 diffs)
-
listDRV.c (added)
-
listDSN.c (added)
-
testOCnn.c (added)
Legend:
- Unmodified
- Added
- Removed
-
tol/dbdrivers/Jamfile
rb7e6cec r70fd0e0 42 42 ; 43 43 } 44 45 exe listDSN : listDSN.c odbc : $(odbc_inc) ; 46 exe testOCnn : testOCnn.c odbc : $(odbc_inc) ; 47 48 explicit listDSN ; 49 explicit testOCnn ; -
tol/dbdrivers/libtolodbc.c
rb7e6cec r70fd0e0 59 59 #define MAX_TEXT_FIELD_LENGTH 2048 60 60 61 //#define TRACE_DEEP 161 #define TRACE_DEEP 1 62 62 63 63 typedef struct odbcdx { … … 80 80 static DBOutWriter stdOutWriter = 0; 81 81 82 void extract_error( 83 char *fn, 84 SQLHANDLE handle, 85 SQLSMALLINT type) 86 { 87 SQLINTEGER i = 0; 88 SQLINTEGER native; 89 SQLCHAR state[ 7 ]; 90 SQLCHAR text[256]; 91 SQLSMALLINT len; 92 SQLRETURN ret; 93 94 fprintf(stderr, 95 "\n" 96 "The driver reported the following diagnostics whilst running " 97 "%s\n\n", 98 fn); 99 100 do 101 { 102 ret = SQLGetDiagRec(type, handle, ++i, state, &native, text, 103 sizeof(text), &len ); 104 if (SQL_SUCCEEDED(ret)) 105 printf("%s:%ld:%ld:%s\n", state, i, native, text); 106 } 107 while( ret == SQL_SUCCESS ); 108 } 109 110 82 111 //------------------------------------------------------------------- 83 112 void getDiagRec(odbcd *dbd, int diagType) … … 93 122 handle = dbd->hstmt; 94 123 } else if(diagType==GET_DIAG_DBC) { 124 #ifdef TRACE_DEEP 125 printf( "Diagnostic for SQL_HANDLE_DBC" ); 126 #endif 95 127 handleType = SQL_HANDLE_DBC; 96 128 handle = dbd->hdbc; 97 129 } 98 130 131 #ifdef TRACE_DEEP 132 extract_error( "TRACE_DEEP", handle, handleType ); 133 #endif 99 134 i = 1; 100 135 while ((rc = SQLGetDiagRec(handleType, handle, i, SqlState, 101 136 &NativeError, Msg, strlen((char*)Msg), 102 137 &MsgLen)) != SQL_NO_DATA) 103 {138 { 104 139 if(rc==SQL_SUCCESS) { 105 140 char outmsg[SQL_MAX_MESSAGE_LENGTH + 50]; … … 219 254 printf( "1.2: SQLSetEnvAttr\n"); 220 255 #endif 256 //SQLSetEnvAttr(env, SQL_ATTR_ODBC_VERSION, (void *) SQL_OV_ODBC3, 0); 221 257 status = SQLSetEnvAttr(dbd->henv, SQL_ATTR_ODBC_VERSION, 222 ( long *)SQL_OV_ODBC2, 0);258 (void *)SQL_OV_ODBC3, 0); 223 259 if(!checkSQLRet(status, dbd, __LINE__, NO_DIAG)) { 224 260 closeODBC(dbd, 1); //"1" -> last step done: SQLAllocHandle SQLHENV
Note: See TracChangeset
for help on using the changeset viewer.
