VS2013 MFC ODBC connection SQL Server database programming (iii)

Source: Internet
Author: User
Tags odbc connection

VS2013 MFC ODBC connection SQL Server database programming (iii)

Reprint Please specify: http://blog.csdn.net/my_acm/article/category/2616577

Following the previous article on the database links and some instructions, this article will be implemented in the database and other operations such as adding and deleting.


As shown is a simple small program that is finalized.

First, add the Nm_click Responder for the list box. Mouse over the list box, right-click Add event handler, locate the Mn_click message, add and edit as shown in.

Add the following code to the response function:


This is done, click on a record in the list box, the record ID and name are displayed in the edit box.


Bind the variable M_class for combo box and add the following code to the initialization function;



Double-click the Add button and add the following code:


Double-click the Delete button and add the following code:



Set the 3 radio buttons to the same group and bind the int variable, right-click on the first radio button to add an event handler


Then manually add an event handler for the other two radio buttons, such as:


Add in the Change function:


Double-click the Query button to add the following code:


Double-click the Modify button to add the following code:


Finally, add exit and show All programs separately:



All features are now added to completion.

VS2013 MFC ODBC connection SQL Server database programming (iii)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.