请问多字段查询语句
如:request.form("xs")request.form("xh")rsquest.form("hb")rsquest.form("hl")我要查询这四个字段,怎...
如:
request.form("xs")
request.form("xh")
rsquest.form("hb")
rsquest.form("hl")
我要查询这四个字段,怎么写?
sql="select * from book where (xs = '"&request.form("xs")&"' ) and (xh'"&request.form("xh")&"'怎么写下去 展开
request.form("xs")
request.form("xh")
rsquest.form("hb")
rsquest.form("hl")
我要查询这四个字段,怎么写?
sql="select * from book where (xs = '"&request.form("xs")&"' ) and (xh'"&request.form("xh")&"'怎么写下去 展开
1个回答
展开全部
养成用变量传递的好习惯:
dim a1,a2,a3,a4,sql
a1 = request.form("xs")
a2 = request.form("xh")
a3 = request.form("hb")
a4 = request.form("hl")
sql="select * from book where xs='" & a1 &"' and xh='" & a2 &"' and hb='" & a3 &"' and hl='" & a4 &"'"
dim a1,a2,a3,a4,sql
a1 = request.form("xs")
a2 = request.form("xh")
a3 = request.form("hb")
a4 = request.form("hl")
sql="select * from book where xs='" & a1 &"' and xh='" & a2 &"' and hb='" & a3 &"' and hl='" & a4 &"'"
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询