git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6284
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
+//#ifdef DBDEBUG_CONSOLE
#ifdef __BORLANDC__
#pragma hdrstop
#ifdef __BORLANDC__
#pragma hdrstop
TablesInUse.DeleteContents(TRUE);
bool found = FALSE;
TablesInUse.DeleteContents(TRUE);
bool found = FALSE;
pNode = TablesInUse.First();
while (pNode && !found)
{
pNode = TablesInUse.First();
while (pNode && !found)
{
// Decrement the wxDB table count
if (pDb)
pDb->nTables--;
// Decrement the wxDB table count
if (pDb)
pDb->nTables--;
if (hstmtInsert)
if (SQLFreeStmt(hstmtInsert, SQL_DROP) != SQL_SUCCESS)
pDb->DispAllErrors(henv, hdbc);
if (hstmtInsert)
if (SQLFreeStmt(hstmtInsert, SQL_DROP) != SQL_SUCCESS)
pDb->DispAllErrors(henv, hdbc);
if (hstmtDelete)
if (SQLFreeStmt(hstmtDelete, SQL_DROP) != SQL_SUCCESS)
if (hstmtDelete)
if (SQLFreeStmt(hstmtDelete, SQL_DROP) != SQL_SUCCESS)
- pDb->DispAllErrors(henv, hdbc);
if (hstmtUpdate)
if (SQLFreeStmt(hstmtUpdate, SQL_DROP) != SQL_SUCCESS)
pDb->DispAllErrors(henv, hdbc);
if (hstmtUpdate)
if (SQLFreeStmt(hstmtUpdate, SQL_DROP) != SQL_SUCCESS)
pDb->DispAllErrors(henv, hdbc);
}
if (hstmtInternal)
if (SQLFreeStmt(hstmtInternal, SQL_DROP) != SQL_SUCCESS)
}
if (hstmtInternal)
if (SQLFreeStmt(hstmtInternal, SQL_DROP) != SQL_SUCCESS)
// Delete dynamically allocated cursors
if (hstmtDefault)
DeleteCursor(hstmtDefault);
// Delete dynamically allocated cursors
if (hstmtDefault)
DeleteCursor(hstmtDefault);
if (hstmtCount)
DeleteCursor(hstmtCount);
if (hstmtCount)
DeleteCursor(hstmtCount);
pDt->second = 0;
pDt->fraction = 0;
break;
pDt->second = 0;
pDt->fraction = 0;
break;
{
case DB_DATA_TYPE_VARCHAR:
{
{
case DB_DATA_TYPE_VARCHAR:
{
- pColDataPtrs[index].PtrDataObj = new char[pColInfs[index].bufferLength+1];
- pColDataPtrs[index].SzDataObj = pColInfs[index].bufferLength;
- pColDataPtrs[index].SqlCtype = SQL_C_CHAR;
- break;
+
+ // Be sure to allocate enough memory
+ if (pColInfs[index].bufferLength >= pColInfs[index].columnSize)
+ {
+ pColDataPtrs[index].PtrDataObj = new char[pColInfs[index].bufferLength+1];
+ pColDataPtrs[index].SzDataObj = pColInfs[index].bufferLength;
+ }
+ else
+ {
+ pColDataPtrs[index].PtrDataObj = new char[pColInfs[index].columnSize+1];
+ pColDataPtrs[index].SzDataObj = pColInfs[index].columnSize;
+ }
+ pColDataPtrs[index].SqlCtype = SQL_C_CHAR;
+ break;
}
case DB_DATA_TYPE_INTEGER:
{
}
case DB_DATA_TYPE_INTEGER:
{