使用ACCESS数据库,表1(A,B,C),将excel批量拷贝到该表,数据如下
A B C
1 1 2
2 3
3 4
4 5
5 6
6 7
用模糊查询 ('select * from 1 where b like '''+edit1.text+''''),结果只显示第一行(edit为空),正常应该显示所有。经常碰到批量拷贝问题,如果碰到单元格为空的就经常查询不出。。各位大大,有没有什么办法可以解决该问题
A B C
1 1 2
2 3
3 4
4 5
5 6
6 7
用模糊查询 ('select * from 1 where b like '''+edit1.text+''''),结果只显示第一行(edit为空),正常应该显示所有。经常碰到批量拷贝问题,如果碰到单元格为空的就经常查询不出。。各位大大,有没有什么办法可以解决该问题
//还真有可能是空格出现的问题.这样查一下 sSQL:= 'select * from 1 where b like'+ QuotedStr('%'+TRIM(edit1.text)+'%')
select * from 1 where b like'+ QuotedStr('%'+' ''%');
select * from 1 where b like'+ QuotedStr('%'+' '+'%');