void Student::Search(SQLRETURN ret, SQLHDBC hDbc, SQLHENV hEnv, int snumber) {
//分配语句句柄
SQLHSTMT hStmt = NULL;
//SQL查询语句
SQLTCHAR sql[] = _T("SELECT * FROM Studentt a,Kaoqin b WHERE a.学号=b.学号 AND a.学号 LIKE ?");
//像这种模糊查询,怎么用参数传递给“?”
//试过了像这种传值,但是不行
ret = SQLAllocHandle(SQL_HANDLE_STMT, hDbc, &hStmt);
ret = SQLBindParameter(hStmt , 1, SQL_PARAM_INPUT, SQL_C_LONG, SQL_INTEGER, 0, 0, (SQLPOINTER)&snumber, 0, NULL );
试过了