simple form with data access (i think!!)

i m very new to c++
i want to show a form contains (ID : , Name :, Age : )
and store the inputs in an .mdb file with butoms that move to first record or Next , Last, Prev., Add, Del, Find, and Close.  is it hard to do that ????
please help....
Who is Participating?
Dont worry about more points, I am just happy to be able to answer a question.

That is why you will be choosing the single form view. The Advance and Previous button will be automatically attached to the Frame and functional.

If your wanting to add buttons to the Form it self then:

Useing the toolbar drag a button onto your form.
Right click the button and goto properties.
Assign the IDC_"Name"  something related to what its going to be ie..
In the other feild for the viewable name put: ADD NAME
Now goto the View on your menu bar and select -> Class Wizard:
with the Message Maps tab selected find your name you gave it ie..
Select it. You will notice on the screen to the right of it with two selections.


Then select  The -> Add Function (BUTTON TO THE RIGHT)
Then select ->Edit Code (button)

This will take you automatically to the spot where the code is going to be implemented.

Add this command to your code:
void CComm_SetView::OnBexit() //Remember CComm_SetView is my name of program
     // TODO: Add your control notification handler code here


Repeat this process for your other commands you want to add.
other commands are as follows:


Allow the user to edit a record:

// Assign your changes
// Save the changes

// This will close the window if you assign a button ie.. EXIT. Then set a command to the button using the // wizard           Note CComm_SetView is my Program yours will be different
void CComm_SetView::OnBexit()
     // TODO: Add your control notification handler code here


Example of setting defaults to your DB variables:
///////////////////////////// You can also set Defaults to a record using a button ///////////////////////////////////////////
void CComm_SetView::ClearAll()
     m_pSet->m_Record_Name = "";
     m_pSet->m_Radio_Number = "";
     m_pSet->m_Call_Sign = "";
     m_pSet->m_Channel_Preset = "0";
     m_pSet->m_Radio_Tune_Mode = "";
     m_pSet->m_Security = "";
     m_pSet->m_Antenna = "";
     m_pSet->m_XMIT_Power = "";
     m_pSet->m_Key = "";
     m_pSet->m_Delay = "";

                   UpdateData(FALSE); // This resets the Dialog window with the new values

Example of deleting a file (example is from book I quoted you before)

void CTestdb5Biew::OnRecordDelete()
             if(MessageBox("Are you sure you want to delet this record?" , "Delete this record?", MB_YESNO |                  MB_ICONQUESTION) == IDYES)
               // Delete the record
              // Move to the previous record
              // Update the form view

I hope this helps, let me know if there is something within your question that I forgot.
But to be honest that book is a great starter for helping you create a form linked with a database.
(And no I make no money of the sale of that book   :)   )
Good luck.
Remember to add one peice at a time and test it. Then keep adding each additional functionality before moving onto the next.
Make your MFC Access Database "FIRST" (Its easier this way). Set up your selected fields your going to want to have in your database and assign the limitations / restrictions for each.

After you have completed your database.

Goto your VC++ program.

Select NEW.

Select the MFC APPWizard.exe
Give your Program a name.
Select OK.
Select Single Document Interface.
Select Next.
Select Databaseview with file support.
Click on the Data Source.
A dialog window will pop up asking you the location of the Database file. Once you locate the file and select it. It will as you the table to reference.
Select it.
Once finished select Next.
You should be at a screen where it will have the Base Class in the bottom left hand corner.
Select CFormView.
(If gone to far back up one)

Select Next.
Now you have your Database linked with a blank Form.
Note you have your advanced arrows on the Frame.
The advance and previous will work. Getting the form to delete a record is a little bit of work.

Now using the toolbar enter in the same number of edit boxes as fields in your database.

Use the static text boxes to the left or right to identify your edit boxes.

Select Edit and then Class wizard.
Select Class Info.
Give your working class a foreign variable:
(common type) m_pSet
Now go to member variables.
Assign your variable for each of your edit boxes.
Do this by selecting the appropriate IDC_[name you gave it]
then select ADD VARIABLE here is where your going to associate it with the variable in your Database field.
You will now see m_pSet-> "Variable name in your database"
You must set your variable type as it is in the Database in order to get the "m_pSet->" to appear.
Ie.. string with string
int with int

Repeat this process for each Edit box.

Your linked now with each variable after you finish and select OK.

If you want a better examble of how to set up the delete portion or want more detailed information of this use your help in the VC++ program or even better for starting out a good book to use for beginners there is the
Teach yourself Visual C++ 6 in 21 Days.

There is a section that covers it specifically.
And yes its accually easy to do.
Good luck.
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

This question is current, others below are not and need your attention please.  ADMINISTRATION WILL BE CONTACTING YOU SHORTLY.  Moderators Computer101, Netminder or Mindphaser will return to finalize these if they are still open in 7 days.  Experts, please post closing recommendations before that time.

Below are your open questions as of today.  Questions which have been inactive for 21 days or longer are considered to be abandoned and for those, your options are:
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you, but may help others. You must tell the participants why you wish to do this, and allow for Expert response.  This choice will include a refund to you, and will move this question to our PAQ (Previously Asked Question) database.  If you found information outside this question thread, please add it.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question (if it has no potential value for others).
   --> Post comments for expert of your intention to delete and why
   --> YOU CANNOT DELETE A QUESTION with comments; special handling by a Moderator is required.

For special handling needs, please post a zero point question in the link below and include the URL (question QID/link) that it regards with details.
Please click this link for Help Desk, Guidelines/Member Agreement and the Question/Answer process.

Click you Member Profile to view your question history and please keep them updated. If you are a KnowledgePro user, use the Power Search option to find them.  

Questions which are LOCKED with a Proposed Answer but do not help you, should be rejected with comments added.  When you grade the question less than an A, please comment as to why.  This helps all involved, as well as others who may access this item in the future.  PLEASE DO NOT AWARD POINTS TO ME.

To view your open questions, please click the following link(s) and keep them all current with updates.

*****  E X P E R T S    P L E A S E  ******  Leave your closing recommendations.
If you are interested in the cleanup effort, please click this link 
POINTS FOR EXPERTS awaiting comments are listed in the link below
Moderators will finalize this question if in @7 days Asker has not responded.  This will be moved to the PAQ (Previously Asked Questions) at zero points, deleted or awarded.
Thanks everyone.
Moderator @ Experts Exchange
raedAuthor Commented:

how can i add buttons to do the the following functions :
First record, Next record, Last Record, Find Record , New Record, Close Form.

raedAuthor Commented:
is it so hard ??? or need more points ????
Can you please response here and finalize this?
Moondancer - EE Moderator
Dear raed

I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. You can always request to keep this question open. But remember, experts can only help you if you provide feedback to their questions.
Unless there is objection or further activity,  I will suggest to accept


comment(s) as an answer.

If you think your question was not answered at all, you can post a request in Community support (please include this link) to refund your points. The link to the Community Support area is:

I think he forgot me.. --- sniff ---
But as far as this question goes, Ive given you all the tools you need there.
Stop crying now :-)

Force accepted

** Mindphaser - Community Support Moderator **
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.