Vs in establishing an empty project when using an ODBC connection, the SQLConnect function always returns -1,MYSQL and the command-line connection database is fine.
Retcode = SQLConnect (HDBC, (sqlchar*)"test", Sql_nts, (sqlchar*)"root ", Sql_nts, (sqlchar*)"", sql_nts);
Originally because my mysql is installed 64 bit, in the ODBC setting is also 64 bit, then vs in the compiler is 32 bit, so will compile to 64 bit just fine,
On the right-hand side of the debug x86, open it.
Select Configuration Manager, enter, and change to x64 on the platform.
After the change is complete, compile again, the system appears "SQLCHAR *" type of the actual participation "Sqlwchar *" type of parameter incompatible "error (¬^?? ¬☆)
The solution to this problem is:
In the debug--Properties--general--character set there, it's good to have multibyte character sets.
This step is changed, debugging runs again, debugging succeeds, SQLConnect also returns 0.
Success
Workaround use SQLConnect to configure ODBC links to use the/C + + return-1