连接数据库中查询条件使用变量
输入要查询的id:<input type="text" name="idquerst" id="idquerst" />
<%
dim textid
textid=idquerst.value
Set rs = Server.CreateObject("ADODB.Connection")
rs.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ="&server.MapPath("data\userdata.mdb")
set us=server.CreateObject("adodb.recordset")
us.open "select * from users where id='" & textid & "'",rs,1,1
response.Write us("username")
response.Write("<p>")
response.Write us("pwd")
%>
上面这段代码不能运行,想根据text中输入的id号在数据库中查询