Reformatted source to normalize spacing/indentation - no code changes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7948 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -82,7 +82,8 @@ wxDb *READONLY_DB;
|
|||||||
/*
|
/*
|
||||||
* This function will return the exact string(s) from the database engine
|
* This function will return the exact string(s) from the database engine
|
||||||
* indicating all error conditions which have just occured during the
|
* indicating all error conditions which have just occured during the
|
||||||
* last call to the database engine.
|
* last call to the database engine for the database connection pointed
|
||||||
|
* to by pDb.
|
||||||
*
|
*
|
||||||
* This demo uses the returned string by displaying it in a wxMessageBox. The
|
* This demo uses the returned string by displaying it in a wxMessageBox. The
|
||||||
* formatting therefore is not the greatest, but this is just a demo, not a
|
* formatting therefore is not the greatest, but this is just a demo, not a
|
||||||
@@ -91,7 +92,7 @@ wxDb *READONLY_DB;
|
|||||||
* NOTE: The value returned by this function is for temporary use only and
|
* NOTE: The value returned by this function is for temporary use only and
|
||||||
* should be copied for long term use
|
* should be copied for long term use
|
||||||
*/
|
*/
|
||||||
const char *GetExtendedDBErrorMsg(char *ErrFile, int ErrLine)
|
const char *GetExtendedDBErrorMsg(wxDb *pDb, char *ErrFile, int ErrLine)
|
||||||
{
|
{
|
||||||
static wxString msg;
|
static wxString msg;
|
||||||
msg = "";
|
msg = "";
|
||||||
@@ -111,32 +112,23 @@ const char *GetExtendedDBErrorMsg(char *ErrFile, int ErrLine)
|
|||||||
msg.Append ("\nODBC errors:\n");
|
msg.Append ("\nODBC errors:\n");
|
||||||
msg += "\n";
|
msg += "\n";
|
||||||
|
|
||||||
/* Scan through each database connection displaying
|
|
||||||
* any ODBC errors that have occured. */
|
|
||||||
wxDbList *pDbList;
|
|
||||||
for (pDbList = PtrBegDbList; pDbList; pDbList = pDbList->PtrNext)
|
|
||||||
{
|
|
||||||
// Skip over any free connections
|
|
||||||
if (pDbList->Free)
|
|
||||||
continue;
|
|
||||||
// Display errors for this connection
|
// Display errors for this connection
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < DB_MAX_ERROR_HISTORY; i++)
|
for (i = 0; i < DB_MAX_ERROR_HISTORY; i++)
|
||||||
{
|
{
|
||||||
if (pDbList->PtrDb->errorList[i])
|
if (pDb->errorList[i])
|
||||||
{
|
{
|
||||||
msg.Append(pDbList->PtrDb->errorList[i]);
|
msg.Append(pDb->errorList[i]);
|
||||||
if (wxStrcmp(pDbList->PtrDb->errorList[i],"") != 0)
|
if (wxStrcmp(pDb->errorList[i],"") != 0)
|
||||||
msg.Append("\n");
|
msg.Append("\n");
|
||||||
// Clear the errmsg buffer so the next error will not
|
// Clear the errmsg buffer so the next error will not
|
||||||
// end up showing the previous error that have occurred
|
// end up showing the previous error that have occurred
|
||||||
wxStrcpy(pDbList->PtrDb->errorList[i],"");
|
wxStrcpy(pDb->errorList[i],"");
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
msg += "\n";
|
msg += "\n";
|
||||||
|
|
||||||
return /*(char*) (const char*) msg*/msg.c_str();
|
return msg.c_str();
|
||||||
} // GetExtendedDBErrorMsg
|
} // GetExtendedDBErrorMsg
|
||||||
|
|
||||||
|
|
||||||
@@ -235,11 +227,11 @@ bool DatabaseDemoApp::OnInit()
|
|||||||
|
|
||||||
// Show the frame
|
// Show the frame
|
||||||
DemoFrame->Refresh();
|
DemoFrame->Refresh();
|
||||||
// DemoFrame->Show(TRUE);
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
} // DatabaseDemoApp::OnInit()
|
} // DatabaseDemoApp::OnInit()
|
||||||
|
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(DatabaseDemoFrame, wxFrame)
|
BEGIN_EVENT_TABLE(DatabaseDemoFrame, wxFrame)
|
||||||
EVT_MENU(FILE_CREATE, DatabaseDemoFrame::OnCreate)
|
EVT_MENU(FILE_CREATE, DatabaseDemoFrame::OnCreate)
|
||||||
EVT_MENU(FILE_RECREATE_TABLE, DatabaseDemoFrame::OnRecreateTable)
|
EVT_MENU(FILE_RECREATE_TABLE, DatabaseDemoFrame::OnRecreateTable)
|
||||||
@@ -250,6 +242,7 @@ BEGIN_EVENT_TABLE(DatabaseDemoFrame, wxFrame)
|
|||||||
EVT_CLOSE(DatabaseDemoFrame::OnCloseWindow)
|
EVT_CLOSE(DatabaseDemoFrame::OnCloseWindow)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
|
|
||||||
// DatabaseDemoFrame constructor
|
// DatabaseDemoFrame constructor
|
||||||
DatabaseDemoFrame::DatabaseDemoFrame(wxFrame *frame, const wxString& title,
|
DatabaseDemoFrame::DatabaseDemoFrame(wxFrame *frame, const wxString& title,
|
||||||
const wxPoint& pos, const wxSize& size):
|
const wxPoint& pos, const wxSize& size):
|
||||||
@@ -258,17 +251,20 @@ DatabaseDemoFrame::DatabaseDemoFrame(wxFrame *frame, const wxString& title,
|
|||||||
// Put any code in necessary for initializing the main frame here
|
// Put any code in necessary for initializing the main frame here
|
||||||
pEditorDlg = NULL;
|
pEditorDlg = NULL;
|
||||||
pParamDlg = NULL;
|
pParamDlg = NULL;
|
||||||
}
|
} // DatabaseDemoFrame constructor
|
||||||
|
|
||||||
|
|
||||||
void DatabaseDemoFrame::OnCreate(wxCommandEvent& event)
|
void DatabaseDemoFrame::OnCreate(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
CreateDataTable(FALSE);
|
CreateDataTable(FALSE);
|
||||||
}
|
} // DatabaseDemoFrame::OnCreate()
|
||||||
|
|
||||||
|
|
||||||
void DatabaseDemoFrame::OnRecreateTable(wxCommandEvent& event)
|
void DatabaseDemoFrame::OnRecreateTable(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
CreateDataTable(TRUE);
|
CreateDataTable(TRUE);
|
||||||
}
|
} // DatabaseDemoFrame::OnRecreate()
|
||||||
|
|
||||||
|
|
||||||
void DatabaseDemoFrame::OnRecreateIndexes(wxCommandEvent& event)
|
void DatabaseDemoFrame::OnRecreateIndexes(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
@@ -288,18 +284,19 @@ void DatabaseDemoFrame::OnRecreateIndexes(wxCommandEvent& event)
|
|||||||
wxEndBusyCursor();
|
wxEndBusyCursor();
|
||||||
wxString tStr;
|
wxString tStr;
|
||||||
tStr = "Error creating CONTACTS indexes.\nNew indexes will be unavailable.\n\n";
|
tStr = "Error creating CONTACTS indexes.\nNew indexes will be unavailable.\n\n";
|
||||||
tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
|
tStr += GetExtendedDBErrorMsg(Contact->GetDb(),__FILE__,__LINE__);
|
||||||
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
|
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
delete Contact;
|
delete Contact;
|
||||||
Contact = NULL;
|
Contact = NULL;
|
||||||
}
|
} // DatabaseDemoFrame::OnRecreateIndexes()
|
||||||
|
|
||||||
void DatabaseDemoFrame::OnExit(wxCommandEvent& event)
|
void DatabaseDemoFrame::OnExit(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
Close();
|
Close();
|
||||||
}
|
} // DatabaseDemoFrame::OnExit()
|
||||||
|
|
||||||
|
|
||||||
void DatabaseDemoFrame::OnEditParameters(wxCommandEvent& event)
|
void DatabaseDemoFrame::OnEditParameters(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
@@ -307,12 +304,14 @@ void DatabaseDemoFrame::OnEditParameters(wxCommandEvent& event)
|
|||||||
BuildParameterDialog(this);
|
BuildParameterDialog(this);
|
||||||
else
|
else
|
||||||
wxMessageBox("Cannot change database parameters while creating or editing a record","Notice...",wxOK | wxICON_INFORMATION);
|
wxMessageBox("Cannot change database parameters while creating or editing a record","Notice...",wxOK | wxICON_INFORMATION);
|
||||||
}
|
} // DatabaseDemoFrame::OnEditParameters()
|
||||||
|
|
||||||
|
|
||||||
void DatabaseDemoFrame::OnAbout(wxCommandEvent& event)
|
void DatabaseDemoFrame::OnAbout(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
wxMessageBox("wxWindows sample program for database classes\n\nContributed on 27 July 1998","About...",wxOK | wxICON_INFORMATION);
|
wxMessageBox("wxWindows sample program for database classes\n\nContributed on 27 July 1998","About...",wxOK | wxICON_INFORMATION);
|
||||||
}
|
} // DatabaseDemoFrame::OnAbout()
|
||||||
|
|
||||||
|
|
||||||
void DatabaseDemoFrame::OnCloseWindow(wxCloseEvent& event)
|
void DatabaseDemoFrame::OnCloseWindow(wxCloseEvent& event)
|
||||||
{
|
{
|
||||||
@@ -369,7 +368,7 @@ void DatabaseDemoFrame::CreateDataTable(bool recreate)
|
|||||||
wxEndBusyCursor();
|
wxEndBusyCursor();
|
||||||
wxString tStr;
|
wxString tStr;
|
||||||
tStr = "Error creating CONTACTS table.\nTable was not created.\n\n";
|
tStr = "Error creating CONTACTS table.\nTable was not created.\n\n";
|
||||||
tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
|
tStr += GetExtendedDBErrorMsg(Contact->GetDb(),__FILE__,__LINE__);
|
||||||
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
|
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
|
||||||
success = FALSE;
|
success = FALSE;
|
||||||
}
|
}
|
||||||
@@ -380,7 +379,7 @@ void DatabaseDemoFrame::CreateDataTable(bool recreate)
|
|||||||
wxEndBusyCursor();
|
wxEndBusyCursor();
|
||||||
wxString tStr;
|
wxString tStr;
|
||||||
tStr = "Error creating CONTACTS indexes.\nIndexes will be unavailable.\n\n";
|
tStr = "Error creating CONTACTS indexes.\nIndexes will be unavailable.\n\n";
|
||||||
tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
|
tStr += GetExtendedDBErrorMsg(Contact->GetDb(),__FILE__,__LINE__);
|
||||||
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
|
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
|
||||||
success = FALSE;
|
success = FALSE;
|
||||||
}
|
}
|
||||||
@@ -410,7 +409,8 @@ void DatabaseDemoFrame::BuildEditorDialog()
|
|||||||
wxMessageBox("Unable to initialize the editor dialog for some reason","Error...",wxOK | wxICON_EXCLAMATION);
|
wxMessageBox("Unable to initialize the editor dialog for some reason","Error...",wxOK | wxICON_EXCLAMATION);
|
||||||
DemoFrame->Close();
|
DemoFrame->Close();
|
||||||
}
|
}
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
wxMessageBox("Unable to create the editor dialog for some reason","Error...",wxOK | wxICON_EXCLAMATION);
|
wxMessageBox("Unable to create the editor dialog for some reason","Error...",wxOK | wxICON_EXCLAMATION);
|
||||||
DemoFrame->Close();
|
DemoFrame->Close();
|
||||||
@@ -483,7 +483,7 @@ Ccontact::~Ccontact()
|
|||||||
{
|
{
|
||||||
wxString tStr;
|
wxString tStr;
|
||||||
tStr = "Unable to Free the Ccontact data table handle\n\n";
|
tStr = "Unable to Free the Ccontact data table handle\n\n";
|
||||||
tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
|
tStr += GetExtendedDBErrorMsg(GetDb(),__FILE__,__LINE__);
|
||||||
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
|
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -617,7 +617,7 @@ void CeditorDlg::OnButton( wxCommandEvent &event )
|
|||||||
{
|
{
|
||||||
wxWindow *win = (wxWindow*) event.GetEventObject();
|
wxWindow *win = (wxWindow*) event.GetEventObject();
|
||||||
OnCommand( *win, event );
|
OnCommand( *win, event );
|
||||||
}
|
} // CeditorDlg::OnButton()
|
||||||
|
|
||||||
|
|
||||||
void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
|
void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
|
||||||
@@ -741,7 +741,7 @@ void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
|
|||||||
{
|
{
|
||||||
wxString tStr;
|
wxString tStr;
|
||||||
tStr = "ODBC error during Query()\n\n";
|
tStr = "ODBC error during Query()\n\n";
|
||||||
tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
|
tStr += GetExtendedDBErrorMsg(Contact->GetDb(),__FILE__,__LINE__);
|
||||||
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
|
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
|
||||||
SetMode(mView);
|
SetMode(mView);
|
||||||
return;
|
return;
|
||||||
@@ -785,7 +785,6 @@ void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
|
|||||||
// display it, if the query string has changed.
|
// display it, if the query string has changed.
|
||||||
if (wxStrcmp(qryWhere, (const char*) Contact->qryWhereStr))
|
if (wxStrcmp(qryWhere, (const char*) Contact->qryWhereStr))
|
||||||
{
|
{
|
||||||
|
|
||||||
Contact->whereStr = "";
|
Contact->whereStr = "";
|
||||||
Contact->SetOrderByClause("NAME");
|
Contact->SetOrderByClause("NAME");
|
||||||
|
|
||||||
@@ -810,7 +809,7 @@ void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
|
|||||||
{
|
{
|
||||||
wxString tStr;
|
wxString tStr;
|
||||||
tStr = "ODBC error during Query()\n\n";
|
tStr = "ODBC error during Query()\n\n";
|
||||||
tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
|
tStr += GetExtendedDBErrorMsg(Contact->GetDb(),__FILE__,__LINE__);
|
||||||
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
|
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -845,7 +844,7 @@ void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
|
|||||||
{
|
{
|
||||||
wxString tStr;
|
wxString tStr;
|
||||||
tStr = "ODBC error during Query()\n\n";
|
tStr = "ODBC error during Query()\n\n";
|
||||||
tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
|
tStr += GetExtendedDBErrorMsg(Contact->GetDb(),__FILE__,__LINE__);
|
||||||
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
|
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -879,7 +878,6 @@ void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // CeditorDlg::OnCommand()
|
} // CeditorDlg::OnCommand()
|
||||||
|
|
||||||
|
|
||||||
@@ -902,7 +900,7 @@ bool CeditorDlg::Initialize()
|
|||||||
{
|
{
|
||||||
wxString tStr;
|
wxString tStr;
|
||||||
tStr.Printf("Unable to open the table '%s'.\n\nTable may need to be created...?\n\n",CONTACT_TABLE_NAME);
|
tStr.Printf("Unable to open the table '%s'.\n\nTable may need to be created...?\n\n",CONTACT_TABLE_NAME);
|
||||||
tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
|
tStr += GetExtendedDBErrorMsg(Contact->GetDb(),__FILE__,__LINE__);
|
||||||
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
|
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
|
||||||
|
|
||||||
bool createTable = (wxMessageBox("Do you wish to try to create/clear the CONTACTS table?","Confirm",wxYES_NO|wxICON_QUESTION) == wxYES);
|
bool createTable = (wxMessageBox("Do you wish to try to create/clear the CONTACTS table?","Confirm",wxYES_NO|wxICON_QUESTION) == wxYES);
|
||||||
@@ -923,7 +921,6 @@ bool CeditorDlg::Initialize()
|
|||||||
// never fail, except in the case of the table not exisiting or the current
|
// never fail, except in the case of the table not exisiting or the current
|
||||||
// user has insufficent privileges to access the table
|
// user has insufficent privileges to access the table
|
||||||
#if 0
|
#if 0
|
||||||
|
|
||||||
// This code is experimenting with a new function that will hopefully be available
|
// This code is experimenting with a new function that will hopefully be available
|
||||||
// in the 2.4 release. This check will determine whether the open failing was due
|
// in the 2.4 release. This check will determine whether the open failing was due
|
||||||
// to the table not existing, or the users privileges being insufficient to
|
// to the table not existing, or the users privileges being insufficient to
|
||||||
@@ -932,7 +929,7 @@ bool CeditorDlg::Initialize()
|
|||||||
{
|
{
|
||||||
wxString tStr;
|
wxString tStr;
|
||||||
tStr.Printf("Unable to open the table '%s'.\n\n",CONTACT_TABLE_NAME);
|
tStr.Printf("Unable to open the table '%s'.\n\n",CONTACT_TABLE_NAME);
|
||||||
tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
|
tStr += GetExtendedDBErrorMsg(Contact->GetDb(),__FILE__,__LINE__);
|
||||||
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
|
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -941,7 +938,7 @@ bool CeditorDlg::Initialize()
|
|||||||
{
|
{
|
||||||
wxString tStr;
|
wxString tStr;
|
||||||
tStr.Printf("Unable to open the table '%s'.\n\n",CONTACT_TABLE_NAME);
|
tStr.Printf("Unable to open the table '%s'.\n\n",CONTACT_TABLE_NAME);
|
||||||
tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
|
tStr += GetExtendedDBErrorMsg(Contact->GetDb(),__FILE__,__LINE__);
|
||||||
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
|
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1034,7 +1031,7 @@ bool CeditorDlg::Initialize()
|
|||||||
{
|
{
|
||||||
wxString tStr;
|
wxString tStr;
|
||||||
tStr = "ODBC error during Query()\n\n";
|
tStr = "ODBC error during Query()\n\n";
|
||||||
tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
|
tStr += GetExtendedDBErrorMsg(Contact->GetDb(),__FILE__,__LINE__);
|
||||||
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
|
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
|
||||||
// GetParent()->Close();
|
// GetParent()->Close();
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -1282,7 +1279,7 @@ bool CeditorDlg::Save()
|
|||||||
{
|
{
|
||||||
wxString tStr;
|
wxString tStr;
|
||||||
tStr = "A duplicate key value already exists in the table.\nUnable to save record\n\n";
|
tStr = "A duplicate key value already exists in the table.\nUnable to save record\n\n";
|
||||||
tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
|
tStr += GetExtendedDBErrorMsg(Contact->GetDb(),__FILE__,__LINE__);
|
||||||
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
|
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1290,7 +1287,7 @@ bool CeditorDlg::Save()
|
|||||||
// Some other unexpexted error occurred
|
// Some other unexpexted error occurred
|
||||||
wxString tStr;
|
wxString tStr;
|
||||||
tStr = "Database insert failed\n\n";
|
tStr = "Database insert failed\n\n";
|
||||||
tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
|
tStr += GetExtendedDBErrorMsg(Contact->GetDb(),__FILE__,__LINE__);
|
||||||
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
|
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1301,7 +1298,7 @@ bool CeditorDlg::Save()
|
|||||||
{
|
{
|
||||||
wxString tStr;
|
wxString tStr;
|
||||||
tStr = "Database update failed\n\n";
|
tStr = "Database update failed\n\n";
|
||||||
tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
|
tStr += GetExtendedDBErrorMsg(Contact->GetDb(),__FILE__,__LINE__);
|
||||||
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
|
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
|
||||||
failed = TRUE;
|
failed = TRUE;
|
||||||
}
|
}
|
||||||
@@ -1406,7 +1403,7 @@ bool CeditorDlg::GetRec(char *whereStr)
|
|||||||
{
|
{
|
||||||
wxString tStr;
|
wxString tStr;
|
||||||
tStr = "ODBC error during Query()\n\n";
|
tStr = "ODBC error during Query()\n\n";
|
||||||
tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
|
tStr += GetExtendedDBErrorMsg(Contact->GetDb(),__FILE__,__LINE__);
|
||||||
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
|
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
|
||||||
|
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
@@ -1500,6 +1497,7 @@ void CparameterDlg::OnButton( wxCommandEvent &event )
|
|||||||
OnCommand( *win, event );
|
OnCommand( *win, event );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CparameterDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
|
void CparameterDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
wxString widgetName;
|
wxString widgetName;
|
||||||
@@ -1657,6 +1655,7 @@ BEGIN_EVENT_TABLE(CqueryDlg, wxDialog)
|
|||||||
EVT_CLOSE(CqueryDlg::OnCloseWindow)
|
EVT_CLOSE(CqueryDlg::OnCloseWindow)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
|
|
||||||
// CqueryDlg() constructor
|
// CqueryDlg() constructor
|
||||||
CqueryDlg::CqueryDlg(wxWindow *parent, wxDb *pDb, char *tblName[], char *pWhereArg) : wxDialog (parent, QUERY_DIALOG, "Query", wxPoint(-1, -1), wxSize(480, 360))
|
CqueryDlg::CqueryDlg(wxWindow *parent, wxDb *pDb, char *tblName[], char *pWhereArg) : wxDialog (parent, QUERY_DIALOG, "Query", wxPoint(-1, -1), wxSize(480, 360))
|
||||||
{
|
{
|
||||||
@@ -1727,7 +1726,7 @@ CqueryDlg::CqueryDlg(wxWindow *parent, wxDb *pDb, char *tblName[], char *pWhereA
|
|||||||
wxEndBusyCursor();
|
wxEndBusyCursor();
|
||||||
wxString tStr;
|
wxString tStr;
|
||||||
tStr = "ODBC error during GetColumns()\n\n";
|
tStr = "ODBC error during GetColumns()\n\n";
|
||||||
tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
|
tStr += GetExtendedDBErrorMsg(pDb,__FILE__,__LINE__);
|
||||||
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
|
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1766,7 +1765,6 @@ CqueryDlg::CqueryDlg(wxWindow *parent, wxDb *pDb, char *tblName[], char *pWhereA
|
|||||||
// Display the dialog window
|
// Display the dialog window
|
||||||
Centre(wxBOTH);
|
Centre(wxBOTH);
|
||||||
ShowModal();
|
ShowModal();
|
||||||
|
|
||||||
} // CqueryDlg() constructor
|
} // CqueryDlg() constructor
|
||||||
|
|
||||||
|
|
||||||
@@ -1779,7 +1777,8 @@ void CqueryDlg::OnButton( wxCommandEvent &event )
|
|||||||
{
|
{
|
||||||
wxWindow *win = (wxWindow*) event.GetEventObject();
|
wxWindow *win = (wxWindow*) event.GetEventObject();
|
||||||
OnCommand( *win, event );
|
OnCommand( *win, event );
|
||||||
}
|
} // CqueryDlg::OnButton()
|
||||||
|
|
||||||
|
|
||||||
void CqueryDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
|
void CqueryDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
@@ -1905,7 +1904,6 @@ void CqueryDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
|
|||||||
pQueryValue1Txt->SetFocus();
|
pQueryValue1Txt->SetFocus();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
||||||
} // Column 2 choice
|
} // Column 2 choice
|
||||||
|
|
||||||
// Add button
|
// Add button
|
||||||
@@ -1913,7 +1911,6 @@ void CqueryDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
|
|||||||
{
|
{
|
||||||
ProcessAddBtn();
|
ProcessAddBtn();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
} // Add button
|
} // Add button
|
||||||
|
|
||||||
// And button
|
// And button
|
||||||
@@ -1921,7 +1918,6 @@ void CqueryDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
|
|||||||
{
|
{
|
||||||
AppendToWhere(" AND\n");
|
AppendToWhere(" AND\n");
|
||||||
return;
|
return;
|
||||||
|
|
||||||
} // And button
|
} // And button
|
||||||
|
|
||||||
// Or button
|
// Or button
|
||||||
@@ -1929,7 +1925,6 @@ void CqueryDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
|
|||||||
{
|
{
|
||||||
AppendToWhere(" OR\n");
|
AppendToWhere(" OR\n");
|
||||||
return;
|
return;
|
||||||
|
|
||||||
} // Or button
|
} // Or button
|
||||||
|
|
||||||
// Left Paren button
|
// Left Paren button
|
||||||
@@ -1937,7 +1932,6 @@ void CqueryDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
|
|||||||
{
|
{
|
||||||
AppendToWhere("(");
|
AppendToWhere("(");
|
||||||
return;
|
return;
|
||||||
|
|
||||||
} // Left Paren button
|
} // Left Paren button
|
||||||
|
|
||||||
// Right paren button
|
// Right paren button
|
||||||
@@ -1945,7 +1939,6 @@ void CqueryDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
|
|||||||
{
|
{
|
||||||
AppendToWhere(")");
|
AppendToWhere(")");
|
||||||
return;
|
return;
|
||||||
|
|
||||||
} // Right Paren button
|
} // Right Paren button
|
||||||
|
|
||||||
// Done button
|
// Done button
|
||||||
@@ -1966,7 +1959,6 @@ void CqueryDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
|
|||||||
wxStrcpy(pWhere, pQuerySqlWhereMtxt->GetValue());
|
wxStrcpy(pWhere, pQuerySqlWhereMtxt->GetValue());
|
||||||
Close();
|
Close();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
} // Done button
|
} // Done button
|
||||||
|
|
||||||
// Clear button
|
// Clear button
|
||||||
@@ -1977,7 +1969,6 @@ void CqueryDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
|
|||||||
if (Ok)
|
if (Ok)
|
||||||
pQuerySqlWhereMtxt->SetValue("");
|
pQuerySqlWhereMtxt->SetValue("");
|
||||||
return;
|
return;
|
||||||
|
|
||||||
} // Clear button
|
} // Clear button
|
||||||
|
|
||||||
// Count button
|
// Count button
|
||||||
@@ -1987,7 +1978,6 @@ void CqueryDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
|
|||||||
ProcessCountBtn();
|
ProcessCountBtn();
|
||||||
wxEndBusyCursor();
|
wxEndBusyCursor();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
} // Count button
|
} // Count button
|
||||||
|
|
||||||
} // CqueryDlg::OnCommand
|
} // CqueryDlg::OnCommand
|
||||||
@@ -2024,7 +2014,6 @@ void CqueryDlg::AppendToWhere(char *s)
|
|||||||
wxString whereStr = pQuerySqlWhereMtxt->GetValue();
|
wxString whereStr = pQuerySqlWhereMtxt->GetValue();
|
||||||
whereStr += s;
|
whereStr += s;
|
||||||
pQuerySqlWhereMtxt->SetValue(whereStr);
|
pQuerySqlWhereMtxt->SetValue(whereStr);
|
||||||
|
|
||||||
} // CqueryDlg::AppendToWhere()
|
} // CqueryDlg::AppendToWhere()
|
||||||
|
|
||||||
|
|
||||||
@@ -2145,7 +2134,7 @@ void CqueryDlg::ProcessCountBtn()
|
|||||||
{
|
{
|
||||||
wxString tStr;
|
wxString tStr;
|
||||||
tStr = "ODBC error during Open()\n\n";
|
tStr = "ODBC error during Open()\n\n";
|
||||||
tStr += GetExtendedDBErrorMsg(__FILE__,__LINE__);
|
tStr += GetExtendedDBErrorMsg(dbTable->GetDb(),__FILE__,__LINE__);
|
||||||
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
|
wxMessageBox(tStr,"ODBC Error...",wxOK | wxICON_EXCLAMATION);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -411,6 +411,8 @@ void ClookUpDlg::OnClose(wxCloseEvent& event)
|
|||||||
if (lookup2)
|
if (lookup2)
|
||||||
delete lookup2;
|
delete lookup2;
|
||||||
|
|
||||||
|
SetReturnCode(1);
|
||||||
|
|
||||||
while (wxIsBusy()) wxEndBusyCursor();
|
while (wxIsBusy()) wxEndBusyCursor();
|
||||||
event.Skip();
|
event.Skip();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user