sql中查询条件是变量怎样编写??
Adodc1.RecordSource = "select * from 表2 where '" & Form4.Text5.Text & "' LIKE '" & Form4.Text6.Text & "%'"
其中Text5,Text6接是可以变化的文本这样写为什么查不到信息?而把'" & Form4.Text5.Text & "'改成表2中的字段就可以了
[解决办法]
Adodc1.RecordSource = "select * from 表2 where " & Form4.Text5.Text & " LIKE '" & Form4.Text6.Text & "%'"
字段名不需要单引号。