SAMPLE: ODBCDATE Sample Illustrates Working with Database Dates

ID: Q117316


The information in this article applies to:


SUMMARY

The ODBCDATE sample illustrates working with dates using the Microsoft Foundation Database Classes. The sample consists of a simple application which has the ability to add, delete, edit, and query for records containing a first name, last name, and birthday date field.

NOTE: With the release of Microsoft Visual C++ 2.0 (and later versions) the TIMESTAMP_STRUCT used in this sample was incorporated into the MFC architecture.


MORE INFORMATION

The following file is available for download from the Microsoft Software Library:

~ ODBCDATE.EXE
For more information about downloading files from the Microsoft Software Library, please see the following article in the Microsoft Knowledge Base:
Q119591 How to Obtain Microsoft Support Files from Online Services


ODBCDATE.EXE contains subdirectories, so after you download it, place it in an empty directory, and use -d option when you run it to extract the sample files. Type the following at the MS-DOS command line:
ODBCDATE -d
See the README.TXT file included with the sample for more information about how to run it.

Some of the techniques illustrated by the ODBCDATE sample include:

ODBCDATE is based on an AppWizard generated application. Files included with the sample which are directly related to working with dates are:
ADDDLG.CPP -
Implements a dialog box which allows the user to add a records to the database.

DELDLG.CPP -
Implements a dialog box which allows the user to delete records from the database.

EDITDLG.CPP -
Implements a dialog box which allows the user to edit existing records in the database.

QUERYDLG.CPP -
Implements a dialog box which allows the user to query for records in the database using any combination of first name, last name, starting date, and ending date.

RFXDATE.CPP -
Implements the RFX_Date function which works with a TIMESTAMP_STRUCT to get around the CTime limit of not being able to represent dates prior to 1970 and after 2038.

Additional query words: kbinf rfx_date timestamp ctime


Keywords          : kbsample kb16bitonly kbDatabase kbMFC kbODBC kbVC 
Version           : 1.50 1.51 1.52
Platform          : WINDOWS 
Issue type        : 

Last Reviewed: July 29, 1999