ODBC database connection: can not convert SQLCHAR * to SQLWCHAR *

gitpage blog address https://xisynotz.xyz

Database course experiment, ODBC programming control heterogeneous databases, a function with SQLConnection (), has appeared

error C2664: 'SQLConnectW': cannot convert parameter 2 from 'SQLCHAR *' to 'SQLWCHAR *'

Cast is useless, because the final is as follows:

When VS2005 in the development process, the default character set is Unicode. So if the string constants used in the program must be converted to Unicode display type, or a compile-time error

amend as below:

Project menu - Project Properties (the last one) - Configuration Properties - General - Item Default - character set will be changed to use the Unicode character set is not set.

Guess you like

Origin blog.csdn.net/saber_jk/article/details/92697511