In my c++ program I connect to the database and execute some SQL queries. Most of my statements execute fine but once in a while I get errors with my insert statements. I am printing out the error using the SQLError like this. unsigned char error[200], szSqlState[91];
Most of the times when I get errors I get the error message in my log files stating an invalid column etc. But some times I get blank line for the error. Did anyone have the same problem. Why do I get a blank line. Please help.Code:long pfNativeError; short pcbErrorMsg; ::SQLError(NULL,hdbc,hstmt,szSqlState, &pfNativeError,(unsigned char*)&error[0],199,&pcbErrorMsg); LogError("Error executing"); LogError((char*)command); LogError((char*)error); ::SQLCancel(hstmt) ;




Reply With Quote