How to enable the program compiled by VC to write SQL statements without garbled characters

Source: Internet
Author: User

When using VC and ADO technology to read and write ntext fields of Database SQL, the written content will be garbled.

Cause: encoding problem

By default, VC does not support Unicode. How to make Vc support Unicode.

The procedure is as follows:

Select "project | Settings" in the main menu to open the Project Settings dialog box => then select the "C/C ++" label => Add Unicode or _ Unicode preprocessing macro commands in the "Preprocessor definitions" edit box.

This will cause lnk2001 errors.

Solution:

Select "project | Settings" in the main menu to open the Project Settings dialog box => then select link ---> select output in category and writeWwinmaincrtstartup 

For details, see msdn98 "Unicode programming summary"

Visual c ++ documentation ------ using Visual C ++ -------------- visual c ++ programmer's guide -------

Adding program functionalty ---------------- details ------------------- interantional proramming topics

---------- Support for Unicode ------- Unicode programming Summary

Unicode programming related connections: http://www.vckbase.com/document/viewdoc? Id = 642

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.