52,787
社区成员
发帖
与我相关
我的任务
分享
dim sql
sql = "select * from Student where 1=1"
dim sno, sname, sex, age '4个参数
'……分别取得参数值并做防注过滤
if sno <> "" then sql = sql & " and SNO like '%" & sno & "%'"
if sname <> "" then sql = sql & " and [Name] like '%" & sname & "%'"
if sex <> "" then sql = sql & " and Sex = '" & sex & "'"
if age <> "" and cint(age) > 0 then sql = sql & " and Age = " & age
'……执行查询