More changes to use the latest wxDb/wxDbTable method enhancements
More Unicode additions git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9291 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -149,15 +149,12 @@ bool DatabaseDemoApp::OnInit()
|
|||||||
delete DbConnectInf;
|
delete DbConnectInf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
READONLY_DB = wxDbGetConnection(DbConnectInf);
|
READONLY_DB = wxDbGetConnection(DbConnectInf);
|
||||||
if (READONLY_DB == 0)
|
if (READONLY_DB == 0)
|
||||||
{
|
{
|
||||||
wxMessageBox(wxT("Unable to connect to the data source.\n\nCheck the name of your data source to verify it has been correctly entered/spelled.\n\nWith some databases, the user name and password must\nbe created with full rights to the CONTACT table prior to making a connection\n(using tools provided by the database manufacturer)"), wxT("DB CONNECTION ERROR..."),wxOK | wxICON_EXCLAMATION);
|
wxMessageBox(wxT("Unable to connect to the data source.\n\nCheck the name of your data source to verify it has been correctly entered/spelled.\n\nWith some databases, the user name and password must\nbe created with full rights to the CONTACT table prior to making a connection\n(using tools provided by the database manufacturer)"), wxT("DB CONNECTION ERROR..."),wxOK | wxICON_EXCLAMATION);
|
||||||
DemoFrame->BuildParameterDialog(NULL);
|
DemoFrame->BuildParameterDialog(NULL);
|
||||||
DbConnectInf->SetDsn("");
|
delete DbConnectInf;
|
||||||
DbConnectInf->SetUid("");
|
|
||||||
DbConnectInf->SetPassword("");
|
|
||||||
wxMessageBox(wxT("Now exiting program.\n\nRestart program to try any new settings."),wxT("Notice..."),wxOK | wxICON_INFORMATION);
|
wxMessageBox(wxT("Now exiting program.\n\nRestart program to try any new settings."),wxT("Notice..."),wxOK | wxICON_INFORMATION);
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
@@ -1656,7 +1653,9 @@ END_EVENT_TABLE()
|
|||||||
|
|
||||||
|
|
||||||
// CqueryDlg() constructor
|
// CqueryDlg() constructor
|
||||||
CqueryDlg::CqueryDlg(wxWindow *parent, wxDb *pDb, wxChar *tblName[], wxChar *pWhereArg) : wxDialog (parent, QUERY_DIALOG, wxT("Query"), wxPoint(-1, -1), wxSize(480, 360))
|
CqueryDlg::CqueryDlg(wxWindow *parent, wxDb *pDb, wxChar *tblName[],
|
||||||
|
const wxString &pWhereArg) :
|
||||||
|
wxDialog (parent, QUERY_DIALOG, wxT("Query"), wxPoint(-1, -1), wxSize(480, 360))
|
||||||
{
|
{
|
||||||
wxBeginBusyCursor();
|
wxBeginBusyCursor();
|
||||||
|
|
||||||
@@ -1668,7 +1667,7 @@ CqueryDlg::CqueryDlg(wxWindow *parent, wxDb *pDb, wxChar *tblName[], wxChar *pWh
|
|||||||
|
|
||||||
// Initialize the WHERE clause from the string passed in
|
// Initialize the WHERE clause from the string passed in
|
||||||
pWhere = pWhereArg; // Save a pointer to the output buffer
|
pWhere = pWhereArg; // Save a pointer to the output buffer
|
||||||
if (wxStrlen(pWhere) > (unsigned int)DB_MAX_WHERE_CLAUSE_LEN) // Check the length of the buffer passed in
|
if (pWhere.Length() > (unsigned int)DB_MAX_WHERE_CLAUSE_LEN) // Check the length of the buffer passed in
|
||||||
{
|
{
|
||||||
wxString s;
|
wxString s;
|
||||||
s.Printf(wxT("Maximum where clause length exceeded.\nLength must be less than %d"), DB_MAX_WHERE_CLAUSE_LEN+1);
|
s.Printf(wxT("Maximum where clause length exceeded.\nLength must be less than %d"), DB_MAX_WHERE_CLAUSE_LEN+1);
|
||||||
@@ -1757,7 +1756,7 @@ CqueryDlg::CqueryDlg(wxWindow *parent, wxDb *pDb, wxChar *tblName[], wxChar *pWh
|
|||||||
|
|
||||||
pQueryHintMsg->SetLabel(langQRY_EQ);
|
pQueryHintMsg->SetLabel(langQRY_EQ);
|
||||||
|
|
||||||
pQuerySqlWhereMtxt->SetValue(pWhere);
|
pQuerySqlWhereMtxt->SetValue(pWhere.c_str());
|
||||||
|
|
||||||
wxEndBusyCursor();
|
wxEndBusyCursor();
|
||||||
|
|
||||||
@@ -1955,7 +1954,7 @@ void CqueryDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
|
|||||||
if (!ValidateWhereClause())
|
if (!ValidateWhereClause())
|
||||||
return;
|
return;
|
||||||
// Copy the where clause to the output buffer and exit
|
// Copy the where clause to the output buffer and exit
|
||||||
wxStrcpy(pWhere, pQuerySqlWhereMtxt->GetValue());
|
pWhere = pQuerySqlWhereMtxt->GetValue();
|
||||||
Close();
|
Close();
|
||||||
return;
|
return;
|
||||||
} // Done button
|
} // Done button
|
||||||
|
@@ -431,7 +431,7 @@ class CqueryDlg : public wxDialog
|
|||||||
wxDbColInf *colInf; // Column inf. returned by db->GetColumns()
|
wxDbColInf *colInf; // Column inf. returned by db->GetColumns()
|
||||||
wxDbTable *dbTable; // generic wxDbTable object for attaching to the table to query
|
wxDbTable *dbTable; // generic wxDbTable object for attaching to the table to query
|
||||||
wxChar *masterTableName; // Name of the table that 'dbTable' will be associated with
|
wxChar *masterTableName; // Name of the table that 'dbTable' will be associated with
|
||||||
wxChar *pWhere; // A pointer to the storage for the resulting where clause
|
wxString pWhere; // A pointer to the storage for the resulting where clause
|
||||||
wxDb *pDB;
|
wxDb *pDB;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -470,7 +470,7 @@ class CqueryDlg : public wxDialog
|
|||||||
|
|
||||||
wxTextCtrl *pFocusTxt;
|
wxTextCtrl *pFocusTxt;
|
||||||
|
|
||||||
CqueryDlg(wxWindow *parent, wxDb *pDb, wxChar *tblName[], wxChar *pWhereArg);
|
CqueryDlg(wxWindow *parent, wxDb *pDb, wxChar *tblName[], const wxString &pWhereArg);
|
||||||
~CqueryDlg();
|
~CqueryDlg();
|
||||||
|
|
||||||
void OnButton( wxCommandEvent &event );
|
void OnButton( wxCommandEvent &event );
|
||||||
|
Reference in New Issue
Block a user