Fixed the QUERY dialog so it would not crash on exit, and the COUNT button now works

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6368 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
George Tasker 2000-03-01 01:01:01 +00:00
parent 2b0b4c55aa
commit 4c4a393f3e
2 changed files with 12 additions and 2 deletions

View File

@ -865,7 +865,7 @@ void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
Contact->whereStr += Contact->qryWhereStr;
}
// Close the expression with a right paren
// Contact->whereStr += ")";
Contact->whereStr += ")";
// Requery the table
Contact->where = (char*) (const char*) Contact->whereStr;
if (!Contact->Query())
@ -1650,6 +1650,11 @@ CqueryDlg::CqueryDlg(wxWindow *parent, wxDB *pDb, char *tblName[], char *pWhereA
} // CqueryDlg() constructor
CqueryDlg::~CqueryDlg()
{
} // CqueryDlg::~CqueryDlg() destructor
void CqueryDlg::OnButton( wxCommandEvent &event )
{
wxWindow *win = (wxWindow*) event.GetEventObject();
@ -1887,6 +1892,7 @@ void CqueryDlg::OnCloseWindow(wxCloseEvent& event)
while (wxIsBusy())
wxEndBusyCursor();
Show(FALSE);
this->Destroy();
} // CqueryDlg::OnCloseWindow()
@ -2025,7 +2031,10 @@ void CqueryDlg::ProcessCountBtn()
}
// Count() with WHERE clause
dbTable->where = (char*) (const char*) pQuerySqlWhereMtxt->GetValue();
wxString whereStr;
whereStr = pQuerySqlWhereMtxt->GetValue();
dbTable->where = (char *)whereStr.GetData();
ULONG whereCnt = dbTable->Count();
// Count() of all records in the table

View File

@ -346,6 +346,7 @@ class CqueryDlg : public wxDialog
wxTextCtrl *pFocusTxt;
CqueryDlg(wxWindow *parent, wxDB *pDb, char *tblName[], char *pWhereArg);
~CqueryDlg();
void OnButton( wxCommandEvent &event );
void OnCommand(wxWindow& win, wxCommandEvent& event);