• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 201
  • Last Modified:

A dialog based application

Hello, I would like to create a dialog-based application (Visual C++ 6.0) that connects to a MSACCESS mdb file called contacts.mdb. My dialog based application design has three input fields (name, cell and location) and a listControl with three buttons (Add to database, Delete a record, Search for record, Display all Records) When you fill out the name, cell and location entries and click on the Add to Database Button, I want to add the data to the contacts.mdb. When you type a name in the input field and click on the Delete a record Button, I want to be able to delete the record. When you type a name in the input field and click on the Search for Record, I want to search the contact.mdb and if found()  bring up a list box and display the name, cell and location of that record. When you click on Display all Records, I want to be able to display a list box listing all the records in the contact.mdb.

Can anyone help me get started on this dialog based application please or has anyone did something like this before and would be co kind to send me the example so that I may be able to learn from it to build my on?
Your consideration is greatly appreciated

0
cybecks
Asked:
cybecks
1 Solution
 
jkrCommented:
As in http:Q_21403070.html

 You'll find all MFC databse samples at http://msdn.microsoft.com/library/en-us/vcsample/html/_core_Databases_Samples.asp ("Database Samples"). Especially http://msdn.microsoft.com/library/en-us/vcsample/html/_sample_mfc_daotable.asp ("DAOTABLE") seems to be what you want:

The DAOTABLE sample demonstrates using the MFC Data Access Objects (DAO) database classes to create common database objects: databases, tables, queries, fields, and indexes. This dialog-based application maps the properties of these objects to controls the user can set and/or view. The source code is organized so that most of the database interaction is isolated from the user-interface code. This makes it easy to identify examples of how one can use the MFC DAO database classes.

In addition to demonstrating the use of the MFC DAO classes, this sample can be a useful tool for creating simple Microsoft Access databases. You can create .mdb files from scratch, create and delete tables and queries, add and delete fields and indexes in the tables, and modify existing queries.

The direct link to the code/.exe is http://download.microsoft.com/download/VisualStudioNET/Sample/7.0/NT5XP/EN-US/mfc_database_daotable.exe
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now