Sample was missing the call to SQLFreeEnv() required to release the ODBC environment handle memory
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7100 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -278,7 +278,13 @@ void DatabaseDemoFrame::OnCloseWindow(wxCloseEvent& event)
|
|||||||
if (pEditorDlg->Close())
|
if (pEditorDlg->Close())
|
||||||
pEditorDlg = NULL;
|
pEditorDlg = NULL;
|
||||||
else
|
else
|
||||||
|
{
|
||||||
event.Veto();
|
event.Veto();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Cleans up the environment space allocated for the SQL/ODBC connection handle
|
||||||
|
SQLFreeEnv(DbConnectInf.Henv);
|
||||||
|
|
||||||
this->Destroy();
|
this->Destroy();
|
||||||
|
|
||||||
@@ -471,7 +477,7 @@ bool Ccontact::FetchByName(char *name)
|
|||||||
{
|
{
|
||||||
whereStr.Printf("NAME = '%s'",name);
|
whereStr.Printf("NAME = '%s'",name);
|
||||||
where = (char*) (const char*) this->whereStr;
|
where = (char*) (const char*) this->whereStr;
|
||||||
orderBy = 0;
|
orderBy = "";
|
||||||
|
|
||||||
if (!Query())
|
if (!Query())
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
@@ -639,7 +645,7 @@ CeditorDlg::CeditorDlg(wxWindow *parent) : wxPanel (parent, 1, 1, 460, 455)
|
|||||||
Contact->where = (char*) (const char*) Contact->whereStr;
|
Contact->where = (char*) (const char*) Contact->whereStr;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Contact->where = 0;
|
Contact->where = "";
|
||||||
|
|
||||||
// Perform the Query to get the result set.
|
// Perform the Query to get the result set.
|
||||||
// NOTE: If there are no rows returned, that is a valid result, so Query() would return TRUE.
|
// NOTE: If there are no rows returned, that is a valid result, so Query() would return TRUE.
|
||||||
@@ -807,7 +813,7 @@ void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
|
|||||||
Contact->where = (char*) (const char*) Contact->whereStr;
|
Contact->where = (char*) (const char*) Contact->whereStr;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Contact->where = 0;
|
Contact->where = "";
|
||||||
|
|
||||||
if (!Contact->Query())
|
if (!Contact->Query())
|
||||||
{
|
{
|
||||||
@@ -2048,7 +2054,7 @@ void CqueryDlg::ProcessCountBtn()
|
|||||||
ULONG whereCnt = dbTable->Count();
|
ULONG whereCnt = dbTable->Count();
|
||||||
|
|
||||||
// Count() of all records in the table
|
// Count() of all records in the table
|
||||||
dbTable->where = 0;
|
dbTable->where = "";
|
||||||
ULONG totalCnt = dbTable->Count();
|
ULONG totalCnt = dbTable->Count();
|
||||||
|
|
||||||
if (whereCnt > 0 || totalCnt == 0)
|
if (whereCnt > 0 || totalCnt == 0)
|
||||||
|
Reference in New Issue
Block a user