Solved

Converting TCHAR

Posted on 2006-06-20
4
731 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Would like to move button in a function 3 71
installing and using WTP plugin eclipse MARS 3 97
Eclipse Neon and jdk 1.8.0 11 122
max float value 3 21
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…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

943 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now