0
我做了连接器/ ODBC成功,那么我写一些代码:SQLAllocConnect成功,但失败的SQLConnect
SQLHENV henv;
SQLHDBC phdbc;
SQLRETURN retcode;
retcode = SQLAllocEnv(&henv);
retcode = SQLAllocConnect(henv,&phdbc);
if(retcode == SQL_SUCCESS)
{
char *a="cc_mysql";
char *b="chen1991";
retcode = SQLConnect(phdbc,(SQLCHAR*)a,SQL_NTS,(SQLCHAR*)b,SQL_NTS,(SQLCHAR*)b,SQL_NTS);
}
,但我无法连接。我调试它,发现SQLAllocConnect返回true,但SQLConnect返回-1,我无法理解发生了什么。