Hi,
I have a fairly simple routine which retrieves a single field. But this
routine will fail after being called exactly 160 times !!!
char* getLastName(char* pId)
{
char* pRetVal = new char(51);
char Statement[255];
sprintf(Statement, "SELECT last_name FROM namemaster WHERE id='%'",
pId);
SQLINTEGER fieldLenOrInd = SQL_NTS;
SQLBindCol(m_hStmt, 1, SQL_C_CHAR, pRetVal, 51, &fieldLenOrInd);
SQLRETURN retcode = SQLExecDirect(m_hStmt, (unsigned char*)&Statement,
SQL_NTS);
retcode = SQLFetch(m_hStmt);
SQLCloseCursor(m_hStmt);
return pRetVal;
For simplicity I removed all error handling, etc. It took me two days toQuote:}
figure out why. But I haven't got any clue.
Please help if you know anything about it. I am using SQL Server 7.0 and
ODBC 3.510.3513.
Thanks a bounch!
Philip