Changeset b7e6cec in tol
- Timestamp:
- Feb 15, 2011, 8:16:13 AM (16 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 70fd0e0
- Parents:
- ac1601a
- File:
-
- 1 edited
-
tol/dbdrivers/libtolodbc.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tol/dbdrivers/libtolodbc.c
rac1601a rb7e6cec 59 59 #define MAX_TEXT_FIELD_LENGTH 2048 60 60 61 //#define TRACE_DEEP 1 62 61 63 typedef struct odbcdx { 62 64 // char *alias; … … 109 111 } 110 112 else if(rc==SQL_SUCCESS_WITH_INFO) { 111 #if defined(_DEBUG) 113 #if defined(_DEBUG) || defined(TRACE_DEEP) 112 114 if(MsgLen>SQL_MAX_MESSAGE_LENGTH) 113 115 stdOutWriter("The *MessageText buffer was too small to hold the " … … 118 120 } 119 121 else if(rc==SQL_INVALID_HANDLE) { 120 #if defined(_DEBUG) 122 #if defined(_DEBUG) || defined(TRACE_DEEP) 121 123 stdOutWriter("The handle indicated by HandleType and Handle was not " 122 124 "a valid handle.\n"); … … 186 188 odbcd *dbd; 187 189 char *alias, *user, *pwd; 190 #ifdef TRACE_DEEP 191 printf( "Entering odbc_Open\n"); 192 #endif 188 193 189 194 dbd = (odbcd*)malloc(sizeof(odbcd)); … … 202 207 203 208 // 1.1: SQLAllocHandle(ENV) 209 #ifdef TRACE_DEEP 210 printf( "1.1: SQLAllocHandle(ENV)\n"); 211 #endif 204 212 status = SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &(dbd->henv)); 205 213 if(!checkSQLRet(status, dbd, __LINE__, GET_DIAG_ENV)) { … … 208 216 209 217 // 1.2: SQLSetEnvAttr 218 #ifdef TRACE_DEEP 219 printf( "1.2: SQLSetEnvAttr\n"); 220 #endif 210 221 status = SQLSetEnvAttr(dbd->henv, SQL_ATTR_ODBC_VERSION, 211 222 (long *)SQL_OV_ODBC2, 0); … … 216 227 217 228 // 1.3: SQLAllocHandle(DBC) 218 status = SQLAllocHandle(SQL_HANDLE_DBC, dbd->henv, &(dbd->hdbc)); 229 #ifdef TRACE_DEEP 230 printf( "1.3: SQLAllocHandle(DBC)\n"); 231 #endif 232 status = SQLAllocHandle(SQL_HANDLE_DBC, dbd->henv, &(dbd->hdbc)); 219 233 if(!checkSQLRet(status, dbd, __LINE__, GET_DIAG_DBC)) { 220 234 closeODBC(dbd, 1); //"1" -> last step done: SQLAllocHandle SQLHENV … … 223 237 224 238 // 1.4: SQLConnect 239 #ifdef TRACE_DEEP 240 printf( "1.4: SQLConnect\n"); 241 printf( "(%s,%s,%s)\n", alias, user, pwd ); 242 #endif 225 243 status = SQLConnect(dbd->hdbc, 226 244 (SQLCHAR*) alias, SQL_NTS, 227 245 (SQLCHAR*) user, SQL_NTS, 228 246 (SQLCHAR*) pwd, SQL_NTS); 247 #ifdef TRACE_DEEP 248 printf( "Status from SQLConnect: %d\n", status ); 249 #endif 229 250 if(!checkSQLRet(status, dbd, __LINE__, GET_DIAG_DBC)) { 230 251 closeODBC(dbd, 2); //"2"-> last step done: SQLAllocHandle of SQLHDBC
Note: See TracChangeset
for help on using the changeset viewer.
