Solved

Converting TCHAR

Posted on 2006-06-20
4
739 Views
Last Modified: 2013-12-14
Hi,

I would like to do following thing:

TCHAR dataType[128];
SDWORD cbdatatype;
SQLGetData(hstmt, 1, SQL_C_CHAR, dataType, sizeof(dataType), &cbdatatype);

if(dataType == "VARCHAR")
{
...
}

the problem is that I cannot compare "VARCHAR" with an array of tchars.


Does someone has a solution?


thx.
0
Comment
Question by:davyberroho
  • 2
  • 2
4 Comments
 
LVL 11

Accepted Solution

by:
Jase-Coder earned 500 total points
ID: 16941462
you have to use strcmp
0
 
LVL 11

Expert Comment

by:Jase-Coder
ID: 16941516
0
 
LVL 48

Expert Comment

by:AlexFM
ID: 16941547
Use _tcscmp function, this is strcmp for TCHAR type:

if(_tcscmp(dataType, _T("VARCHAR") == 0 )
{
}

0
 
LVL 48

Expert Comment

by:AlexFM
ID: 16941554
Read more about TCHAR and Unicode here:
http://www.codeproject.com/cpp/unicode.asp
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question