response.write(sqlstr2)的结果为最后一句(红色),应该没问题吧 maths 教师 teac1 pass1 select * from sj_large where sj_name='maths' and sj_teacher='teac1' and teac_pwd='pass1' and isready='false' 测试文件内容如下: <% subject1=Request.Form("subject") type1=Request.Form("type") name1=Request.Form("name") password1=Request.Form("pass") Response.Write subject1 Response.Write "<br>" Response.Write type1 Response.Write "<br>" Response.Write name1 Response.Write "<br>" Response.Write password1 Response.Write "<br>" %>
<% set conn_str=server.createObject("ADODB.Connection") dbpath_str=server.MapPath("ks_auto.mdb") conn_str.open "driver={microsoft Access driver (*.mdb)};dbq="&dbpath_str if Request.Form("type")="教师" then sqlstr2="select * from sj_large where sj_name='" & subject1 & "' and sj_teacher='" & name1 & "' and teac_pwd='" &
password1 & "' and isready='false'" Response.Write(sqlstr2) end if %>
<% conn_str.close set conn_str=nothing %>