Click here to Skip to main content
15,923,168 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalmemory leak when using fstream,seek for help Pin
white jungle2-Aug-05 23:31
white jungle2-Aug-05 23:31 
GeneralRe: memory leak when using fstream,seek for help Pin
benjymous2-Aug-05 23:41
benjymous2-Aug-05 23:41 
GeneralRe: memory leak when using fstream,seek for help Pin
white jungle3-Aug-05 0:01
white jungle3-Aug-05 0:01 
GeneralRe: memory leak when using fstream,seek for help Pin
Blake Miller3-Aug-05 10:46
Blake Miller3-Aug-05 10:46 
GeneralRe: memory leak when using fstream,seek for help Pin
white jungle3-Aug-05 15:52
white jungle3-Aug-05 15:52 
GeneralSQLPrepare Error Pin
mihirvc2-Aug-05 23:27
mihirvc2-Aug-05 23:27 
GeneralRe: SQLPrepare Error Pin
Marc Soleda2-Aug-05 23:33
Marc Soleda2-Aug-05 23:33 
GeneralRe: SQLPrepare Error Pin
mihirvc2-Aug-05 23:39
mihirvc2-Aug-05 23:39 
HSTMT hStatement = NULL;
m_strSQLState = "";
m_strErrorString ="";
m_lNativeError = 0;

if( !m_pConnection )
{
if (CDatabaseManager::m_nLogLevel > 0)
DumpInfo(CDatabaseManager::m_pLog,"No Database connection exists");
return FALSE;
}

if(strSQL == "")
{
if (CDatabaseManager::m_nLogLevel > 0)
DumpInfo(CDatabaseManager::m_pLog,"Not a valid SQL statment");
return FALSE;
}

if (bDisplaySQL)
{
if (CDatabaseManager::m_nLogLevel > 0)
DumpInfo(CDatabaseManager::m_pLog,"[ActionQuery] SQL Statement is:" + strSQL);
}

RETCODE rCode;
HDBC hDbc = m_pConnection->m_hODBC;
HENV hEnv = m_pConnection->m_hEnv;

//Allocate the statement
rCode = ::SQLAllocStmt(hDbc,&hStatement);
if(rCode != SQL_SUCCESS)
{
if (CDatabaseManager::m_nLogLevel > 0)
DumpInfo(CDatabaseManager::m_pLog,"SQLAllocStmt Error");
CheckSQLError(hStatement);
return FALSE;
}

rCode = ::SQLSetStmtOption(hStatement,SQL_CONCURRENCY,SQL_CONCUR_VALUES);
if( (rCode != SQL_SUCCESS) && (rCode !=SQL_SUCCESS_WITH_INFO) )
{
if (CDatabaseManager::m_nLogLevel > 0)
DumpInfo(CDatabaseManager::m_pLog,"SQLSetStmtOption Error:");
if (CDatabaseManager::m_nLogLevel > 0)
DumpInfo(CDatabaseManager::m_pLog,"[Warning]Lock during action query may not be available");
CheckSQLError(m_hStatement);
}

//Prepare the allocated statement
rCode = ::SQLPrepare(hStatement,(unsigned char*)LPCTSTR(strSQL),strSQL.GetLength() );
if(rCode != SQL_SUCCESS)
{
if (CDatabaseManager::m_nLogLevel > 0)
DumpInfo(CDatabaseManager::m_pLog,"SQLPrepare Error:");
CheckSQLError(hStatement);
::SQLFreeStmt(hStatement,SQL_DROP);
return FALSE;
}

//Execute the prepared SQL statement
rCode = ::SQLExecute(hStatement);
if((rCode != SQL_SUCCESS) && (rCode != SQL_SUCCESS_WITH_INFO))
{

if (CDatabaseManager::m_nLogLevel > 0)
DumpInfo(CDatabaseManager::m_pLog,"SQLExecute Error");
CheckSQLError(hStatement);
::SQLFreeStmt(hStatement,SQL_DROP);
return FALSE;
}

::SQLFreeStmt(hStatement,SQL_DROP);

return TRUE;


and strSQL = "{call MTMS_TCMD.FMForLoad(82,'ETR Data not available!')}";

Regards,
Mihir Shroff
GeneralMS DataGrid Control Pin
Fabio Panzavolta2-Aug-05 22:25
Fabio Panzavolta2-Aug-05 22:25 
Questionwhat is a multiplexing server? Pin
ThinkingPrometheus2-Aug-05 22:17
ThinkingPrometheus2-Aug-05 22:17 
AnswerRe: what is a multiplexing server? Pin
Alexander M.,3-Aug-05 4:00
Alexander M.,3-Aug-05 4:00 
GeneralRe: what is a multiplexing server? Pin
ThinkingPrometheus9-Aug-05 21:08
ThinkingPrometheus9-Aug-05 21:08 
GeneralEdit Box Intresting Pin
Halawlaws2-Aug-05 21:48
Halawlaws2-Aug-05 21:48 
GeneralRe: Edit Box Intresting Pin
toxcct2-Aug-05 22:25
toxcct2-Aug-05 22:25 
GeneralRe: Edit Box Intresting Pin
Eytukan2-Aug-05 23:24
Eytukan2-Aug-05 23:24 
GeneralRe: Edit Box Intresting Pin
Halawlaws2-Aug-05 23:28
Halawlaws2-Aug-05 23:28 
GeneralRe: Edit Box Intresting Pin
Marc Soleda2-Aug-05 23:30
Marc Soleda2-Aug-05 23:30 
GeneralFTP Pin
Aditya Rao2-Aug-05 20:59
Aditya Rao2-Aug-05 20:59 
GeneralRe: FTP Pin
Jörgen Sigvardsson2-Aug-05 21:28
Jörgen Sigvardsson2-Aug-05 21:28 
GeneralLIBCD.lib(crt0.obj):error LNK2001:unresolved external sybol _main Pin
momer2-Aug-05 20:47
momer2-Aug-05 20:47 
GeneralRe: LIBCD.lib(crt0.obj):error LNK2001:unresolved external sybol _main Pin
toxcct2-Aug-05 22:36
toxcct2-Aug-05 22:36 
GeneralRe: LIBCD.lib(crt0.obj):error LNK2001:unresolved external sybol _main Pin
momer3-Aug-05 15:20
momer3-Aug-05 15:20 
GeneralSpilit the Status Bar in a Horizontal Pin
ditty grail2-Aug-05 20:26
ditty grail2-Aug-05 20:26 
QuestionWhat create static\dynamic library and use them? Pin
guguqiaqia2-Aug-05 20:12
guguqiaqia2-Aug-05 20:12 
AnswerRe: What create static\dynamic library and use them? Pin
toxcct2-Aug-05 22:23
toxcct2-Aug-05 22:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.