dim str as string str="jhone" rs.open "select * from 仓库情况 where emp_name = '" & str & "' ",cn,
也有这么用 dim str as string if trim(text1.text) <> "" then str=" and name = '" & trim(text1.text) & "' " end if rs.open "select * from 仓库情况 where 1=1 " & str,cn,
我说的是where后面直接跟字符串,请问怎样书写
rs.open "select * from 仓库情况 where " & str,
rs.open "select * from 仓库情况 where " & str,cn
其实没看懂你在说什么,什么叫在where后面直接使用字符串?rs.open"select * from 仓库情况 where 数据库字段名 逻辑运算符 条件",cn,1,3
又想了想你可能是想要这样: dim str as string str="name='王五'"'假设条件字段为name rs.open "select * from 仓库情况 where " & str ,cn,1,3 或是: rs.open"select * from 仓库情况 where name='王五'",cn,1,3
dim str as string str="jhone" rs.open "select * from 仓库情况 where emp_name = '" & str & "' ",cn,
以上回复不知有没有符合你条件的,关键是你的这个str 字符串具体是上面内容.
rs.open "select * from 仓库情况 where " & str ,cn,1,3 就是我要的情况,谢谢各位老师
str="jhone"
rs.open "select * from 仓库情况 where emp_name = '" & str & "' ",cn,
dim str as string
if trim(text1.text) <> "" then
str=" and name = '" & trim(text1.text) & "' "
end if
rs.open "select * from 仓库情况 where 1=1 " & str,cn,
dim str as string
str="name='王五'"'假设条件字段为name
rs.open "select * from 仓库情况 where " & str ,cn,1,3
或是:
rs.open"select * from 仓库情况 where name='王五'",cn,1,3
str="jhone"
rs.open "select * from 仓库情况 where emp_name = '" & str & "' ",cn,
就是我要的情况,谢谢各位老师