mysql> select * from exam where an='b';
+--------+--------+------+------+------+------+------+--------------------------
--------------------------------------------------------------------------------
-------------------------------+
| 题目ID | 题型ID | an | 难度 | 要求 | 图片 | 章节 | 题干
|
+--------+--------+------+------+------+------+------+--------------------------
--------------------------------------------------------------------------------
-------------------------------+
| 1 | 101 | b | 难 | NULL | NULL | 0 | 被誉为方书之祖的方书是(
)
A.《黄帝内经》
B.《五十二病方》
C.《千金方》
D.《普济方》
E.《伤寒杂病论》
|
| 2 | 101 | b | 难 | NULL | NULL | 0 | 《千金方》的作者是(
)
A.汉代
B.唐代
C.宋代
D.明代
E.清代
在mysql命令行下的sql语句是正确的。但是我移植到 vc在odbc下查询就出现的语句错误的模式
odbc
mydatadlg.Open(NULL,0,0,_T("ODBC;DSN=hu;UID=root;PWD=123"));(mydatadlg我定义的CDatabase类)
Cexamstu_MULTI rs(&mydatadlg);(Cexamstu_MULTI CRecordset类)
rs.Open(CRecordset::forwardOnly,_T("select * from exam;"),CRecordset::readOnly);
rs.m_strFilter=“an=’a‘”;
rs.Requery();
you have an error in your SQL syntax;check the manual that corresponds to your MySQL server version for the right syntax to use near';WHERE an='a';'at the line1;求论坛中大虾们指教在vc模式下如何查询mysql
+--------+--------+------+------+------+------+------+--------------------------
--------------------------------------------------------------------------------
-------------------------------+
| 题目ID | 题型ID | an | 难度 | 要求 | 图片 | 章节 | 题干
|
+--------+--------+------+------+------+------+------+--------------------------
--------------------------------------------------------------------------------
-------------------------------+
| 1 | 101 | b | 难 | NULL | NULL | 0 | 被誉为方书之祖的方书是(
)
A.《黄帝内经》
B.《五十二病方》
C.《千金方》
D.《普济方》
E.《伤寒杂病论》
|
| 2 | 101 | b | 难 | NULL | NULL | 0 | 《千金方》的作者是(
)
A.汉代
B.唐代
C.宋代
D.明代
E.清代
在mysql命令行下的sql语句是正确的。但是我移植到 vc在odbc下查询就出现的语句错误的模式
odbc
mydatadlg.Open(NULL,0,0,_T("ODBC;DSN=hu;UID=root;PWD=123"));(mydatadlg我定义的CDatabase类)
Cexamstu_MULTI rs(&mydatadlg);(Cexamstu_MULTI CRecordset类)
rs.Open(CRecordset::forwardOnly,_T("select * from exam;"),CRecordset::readOnly);
rs.m_strFilter=“an=’a‘”;
rs.Requery();
you have an error in your SQL syntax;check the manual that corresponds to your MySQL server version for the right syntax to use near';WHERE an='a';'at the line1;求论坛中大虾们指教在vc模式下如何查询mysql
2 rs.m_strFilter=“an=’a‘”;-> rs.m_strFilter="an='a'";