I copied and pasted the code from here https://docs.microsoft.com/en-us/sql/odbc/reference/syntax/sqldriverconnect-function?view=sql-server-ver15 to Visual Studio 2017. When compile I got the error:
“SQLRETURN SQLDriverConnectW(SQLHDBC,SQLHWND,SQLWCHAR *,SQLSMALLINT,SQLWCHAR *,SQLSMALLINT,SQLSMALLINT *,SQLUSMALLINT)': cannot convert argument 3 from 'SQLCHAR *' to 'SQLWCHAR * “
Any one faces the same issue?
@chanmmn -- thank you for your feedback. Please consider these resources, and let me know if you find an answer:
Unfortunately, there is nothing relevant at the MS Q&A, DB Stack Exchange and Stack Overflow on this.
@chanmmn -- thank you for your update.
@David-Engel -- please look into this potential documentation issue.
@v-makouz - Can you validate the code sample on this page? Thanks!
The code compiled and ran correctly when I tried just now, the above mentioned error is usually caused by the project settings. In Visual Studio 17 it is in _Project Properties -> General -> Project Defaults -> Character Set_, if that property is set to "Unicode" one would get that error.
@chanmmn I'm going to close the issue now since this doesn't appear to be a doc issue. If the above doesn't work for you, feel free to @ me or v-makouz on here.
Most helpful comment
The code compiled and ran correctly when I tried just now, the above mentioned error is usually caused by the project settings. In Visual Studio 17 it is in _Project Properties -> General -> Project Defaults -> Character Set_, if that property is set to "Unicode" one would get that error.