Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 762
  • Last Modified:

Converting TCHAR

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
davyberroho
Asked:
davyberroho
  • 2
  • 2
1 Solution
 
Jase-CoderCommented:
you have to use strcmp
0
 
AlexFMCommented:
Use _tcscmp function, this is strcmp for TCHAR type:

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

0
 
AlexFMCommented:
Read more about TCHAR and Unicode here:
http://www.codeproject.com/cpp/unicode.asp
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now