I have a Windows application written using Visual C++. The data for the application is written to a single file. The application reads the file into memory and saves data to the file when the user clicks Save. This only allows for a single user. It is required to update the application so that it uses a database so as to enable many users to use the application at the same time.
1. Looking at the code I can see the following information is saved out to file
ar << theApp.m_strSignature;
ar << theApp.m_dwVersion;
ar << m_strPassword;
ar << (WORD)m_bSmartcardVersion;
ar << (WORD)m_bDatabaseVersion;
ar << m_wMinorVersion;
TaxiFleet contains the taxi information (car details and maintenance details). This is a class with a generic array of member variables.
TaxiDrivers contains the driver information (names, ID numbers, addresses, date of birth, etc). This is a class with a generic array of member variables.
RentalSchemes contains the rental information for each shift in the week. This is a class with a generic array of member variables.
TaxiCosts, OfficeCosts and OtherCosts contains income and expenditure details. This is a class with a generic array of member variables.
TaxiRoster contains the details of each shift (car, driver, kilometres, fuel used, money, etc). This is a class with a generic array of member variables.
The attached file contains nearly all the fields (could be missing a few only). This would give a good indication of the size and complexity of the database.
There is a search function that can query all this information to produce reports.
2. I would prefer to use the standard Microsoft functions that come with visual studio 2008, so CDatabase is preferred.
3. It is not required to update the database at every lostfocus. The database can be updated when a dialogue box is closed with the OK button. All the fields in the dialogue box can then be saved to the database. I think this will make the code easier and will involve less changes. A read from the database can be done when a dialogue box is opened. There should not be more than one user that has the same information open at the same time. For example two users will not be writing shift information for the same shift at the same time. They will be writing shift information for different shifts at the same time.