VB 2008 DataGridView 变量查询问题
使用添加查询选项,用平时的SQL语句写法,select * from jewels where name like '" & iId & "%' ,,,,为什么查询结果会是空,,在formload里有写,iId="d"我把变量换成常量就正常,返回我要的结果
select * from jewels where name like 'd%'
语法问题?还是? ,MD!!!MSDN上都没人回答 \"\'\"&lid&\"%\'\" sql_str=\"select * from jewels where name like \'d%\'\"
sql_str=\"select * from jewels where name like \'\" & iId & \"%\'\"
貌似没问题吧,把“\'”换成 chr(34)看看?~~~ form_load里面在iId=\"d\"之后有刷新吗? 把iId=\"d\"挪到select * from jewels where name like \'\" & iId & \"%\'
上面一行,会出现正常还是空白的结果?
很有可能是SQL query在formload变量数值确定之前就已经被执行了。
页:
[1]