+// Define a new application type
+class DatabaseDemoApp: public wxApp
+{
+ public:
+ // These are the parameters that are stored in the "PARAM_FILENAME" file
+ // that are read in at startup of the program that indicate the connection
+ // parameters to be used for connecting to the ODBC data source.
+ Cparameters params;
+
+ // Pointer to the main frame used by the App
+ DatabaseDemoFrame *DemoFrame;
+
+ // Pointer to the main database connection used in the program. This
+ // pointer would normally be used for doing things as database lookups
+ // for user login names and passwords, getting workstation settings, etc.
+ //
+ // ---> IMPORTANT <---
+ //
+ // For each database object created which uses this wxDb pointer
+ // connection to the database, when a CommitTrans() or RollBackTrans()
+ // will commit or rollback EVERY object which uses this wxDb pointer.
+ //
+ // To allow each table object (those derived from wxDbTable) to be
+ // individually committed or rolled back, you MUST use a different
+ // instance of wxDb in the constructor of the table. Doing so creates
+ // more overhead, and will use more database connections (some DBs have
+ // connection limits...), so use connections sparringly.
+ //
+ // It is recommended that one "main" database connection be created for
+ // the entire program to use for READ-ONLY database accesses, but for each
+ // table object which will do a CommitTrans() or RollbackTrans() that a
+ // new wxDb object be created and used for it.
+ wxDb *READONLY_DB;
+
+ // Contains the ODBC connection information used by
+ // all database connections
+ wxDbConnectInf *DbConnectInf;
+
+ bool OnInit();
+
+ // Read/Write ODBC connection parameters to the "PARAM_FILENAME" file
+ bool ReadParamFile(Cparameters ¶ms);
+ bool WriteParamFile(Cparameters ¶ms);
+
+ void CreateDataTable(bool recreate);
+}; // DatabaseDemoApp
+
+
+DECLARE_APP(DatabaseDemoApp)
+