Note: Use stringfromguid2 to convert the guid to a string.

Source: Internet
Author: User

For vc ole db programming, You need to convert the data of the dbtype_guid type into a string for display. After searching for the data for half a day in msdn, you cannot find a clue. Finally, you should use the stringfromguid2 function through Google, so make a note. RelatedCodeAs follows:

Case dbtype_guid:
{
Guid * guid = (guid *) Rs. getvalue (COL );

Wchar * pbuf = new wchar [48]; // It is very suitable for storing the space of text strings
: Stringfromguid2 (* guid, pbuf, 48 );

Pfield-> put_asstring (pbuf); // text string obtained by application Conversion

Delete [] pbuf;
}
Break;

Other related functions: stringfromclsid and clsidfromstring. For more information, see msdn.

 

Report tools are recommended. Report grid ++ report (www.rubylong.cn)

 

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.