]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/db/dbtest.cpp
Typo in image sample (displayed PNM, not TIFF).
[wxWidgets.git] / samples / db / dbtest.cpp
index 81dfc6e7f7e01912c6a9fd2af62a0a818177a21c..a8afaf4139c1cfbfd0c8f11bbe6bf8688523d8e0 100644 (file)
@@ -46,7 +46,7 @@
 #include <wx/db.h>                  /* Required in the file which will get the data source connection */
 #include <wx/dbtable.h>             /* Has the wxTable object from which all data objects will inherit their data table functionality */
 
-extern DbList* WXDLLEXPORT PtrBegDbList;    /* from db.cpp, used in getting back error results from db connections */
+extern DbList WXDLLEXPORT *PtrBegDbList;    /* from db.cpp, used in getting back error results from db connections */
 
 #include "dbtest.h"                 /* Header file for this demonstration program */
 #include "listdb.h"                 /* Code to support the "Lookup" button on the editor dialog */
@@ -168,12 +168,18 @@ bool DatabaseDemoApp::OnInit()
                return NULL;
        }
 
+       params.ODBCSource[0] = 0;
+       params.UserName[0]      = 0;
+       params.Password[0]      = 0;
+       params.DirPath[0]               = 0;
+
        FILE *paramFile;
        if ((paramFile = fopen(paramFilename, "r")) == NULL)
        {
                wxString tStr;
                tStr.Printf("Unable to open the parameter file '%s' for reading.\n\nYou must specify the data source, user name, and\npassword that will be used and save those settings.",paramFilename);
                wxMessageBox(tStr,"File I/O Error...",wxOK | wxICON_EXCLAMATION);
+
                DemoFrame->BuildParameterDialog(NULL);
                if ((paramFile = fopen(paramFilename, "r")) == NULL)
                        return FALSE;
@@ -434,7 +440,7 @@ bool Ccontact::CreateIndexes(void)
 
        bool            Ok = TRUE;
 
-       strcpy(idxDef[0].ColName, "IS_DEVELOPER");
+       strcpy(idxDef[0].ColName, "IS_DEV");
        idxDef[0].Ascending = TRUE;
 
        strcpy(idxDef[1].ColName, "NAME");
@@ -1429,7 +1435,8 @@ bool CparameterDlg::PutData()
        FillDataSourceList();
 
        // Fill in the fields from the params object
-       pParamODBCSourceList->SetStringSelection(wxGetApp().params.ODBCSource);
+       if (wxGetApp().params.ODBCSource && wxStrlen(wxGetApp().params.ODBCSource))
+               pParamODBCSourceList->SetStringSelection(wxGetApp().params.ODBCSource);
        pParamUserNameTxt->SetValue(wxGetApp().params.UserName);
        pParamPasswordTxt->SetValue(wxGetApp().params.Password);
        pParamDirPathTxt->SetValue(wxGetApp().params.DirPath);