CString st_sql, st_sql2;
st_sql2 = "as";
st_sql = "SELECT * FROM NoteTree where NoteText =" '"+st_sql2"';这个SQL语句,在VC+ADO+ACCESS中为什么出错呢?
正确的该怎么写?
st_sql2 = "as";
st_sql = "SELECT * FROM NoteTree where NoteText =" '"+st_sql2"';这个SQL语句,在VC+ADO+ACCESS中为什么出错呢?
正确的该怎么写?
A: 想用数值吧,就这样
int st_sql2;
st_sql = "SELECT * FROM NoteTree where NoteText = " + st_sql2;
CString st_sql2 = "2";
这样才能相 + ,即:
st_sql = "SELECT * FROM NoteTree where NoteText = " + st_sql2;