广州很顺建材有限公司:我要读本页内文本框的内容作为ASP数据查询条件时有错

来源:百度文库 编辑:中科新闻网 时间:2024/05/13 18:56:39
代码如下,
错误为"t=document.lst.all.txtuserName.value"

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>
</head>

<body>
<form name="lst">
<p align="center"> </p>
<p align="center">
<input type="text" name="txtuserName" onchange="dbset()" size="20">
<%
Set Con = Server.CreateObject( "ADODB.Connection" )
Con.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("DB.mdb")
dim t
t = document.lst.all.txtuserName.value
Set RS = Con.Execute ("SELECT * FROM 客户资料 WHERE 客户名称 like '"&t&"%'")
%>
<p align="center">
<select size="2" name="drpAffairExamineDept" style="HEIGHT:100px; WIDTH:100px;color:#000000" LANGUAGE="javascript">
<% While NOT RS.EOF %>
<option value="<%=RS( "查看详情" )%>"><%=RS( "客户名称" )%></option>
</tr>
<%
RS.MoveNext
Wend
RS.Close
Response.write(t)
%>
</select>
</p>
</form>
</body>
</html>