注册 登录
编程论坛 jQuery论坛

求助各位大哥下拉菜单点击后无法显示相关数据是什么问题

zhao51708607 发布于 2011-09-04 03:29, 1292 次点击
小弟是菜鸟,望各位帮忙指教,谢谢
代码如下
<%@LANGUAGE="VBSCRIPT"%>
<!--#include virtual="/Connections/we.asp" -->
<%
Dim Recordset1
Dim Recordset1_cmd
Dim Recordset1_numRows

Set Recordset1_cmd = Server.CreateObject (")
Recordset1_cmd.ActiveConnection = MM_we_STRING
Recordset1_ = "SELECT * FROM web"
Recordset1_cmd.Prepared = true

Set Recordset1 = Recordset1_cmd.Execute
Recordset1_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = -1
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www. xmlns="http://www.
<head><title>Untitled Document</title>
<script type="text/javascript">
function showCustomer(str)
{
var xmlhttp;   
if (str=="")
  {
  document.getElementById("txtHint").innerHTML="";
  return;
  }
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","/Connections/getcustomer.asp?q="+str,true);
xmlhttp.send();
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><style type="text/css">
<!--
body,td,th {
    font-family: Verdana, Geneva, sans-serif;
}
-->
</style></head>
<body>

<form action="" style="margin-top:15px;">
  xuanze
    <select name="select" id="select">
      <%
While (NOT Recordset1.EOF)
%>
      <option value="<%=(Recordset1.Fields.Item("ID").Value)%>" <%If (Not isNull((Recordset1.Fields.Item("ID").Value))) Then If (CStr(Recordset1.Fields.Item("ID").Value) = CStr((Recordset1.Fields.Item("ID").Value))) Then Response.Write("selected=""selected""") : Response.Write("")%> ><%=(Recordset1.Fields.Item("ID").Value)%></option>
      <%
  Recordset1.MoveNext()
Wend
If (Recordset1.CursorType > 0) Then
  Recordset1.MoveFirst
Else
  Recordset1.Requery
End If
%>
  </select>
</form>
<br />
<div id="txtHint">客户信息将在此处列出 ...</div>

<p>&nbsp;</p>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>

文件getcustomer.asp的代码如下:
<%
response.expires=-1
sql="SELECT * FROM CUSTOMERS WHERE CUSTOMERID="
sql=sql & "'" & request.querystring("q") & "'"

set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open(Server.Mappath("/Database21.mdb"))
set rs=Server.CreateObject("ADODB.recordset")
rs.Open sql,conn

response.write("<table>")
do until rs.EOF
  for each x in rs.Fields
    response.write("<tr><td><b>" & x.name & "</b></td>")
    response.write("<td>" & x.value & "</td></tr>")
  next
  rs.MoveNext
loop
response.write("</table>")
%>
1 回复
#2
woyington2012-08-29 16:09
我是懒人的代表了,又想减肥,又怕运动,还有叫我不吃东西实在是难受的。也经常买了很多减肥药,对我都不管用。这次 NE 减 肥 茶 终于实现了我的梦想,照样吃和睡,轻轻松松了就减了13斤下来。我是找中 国总 代 理 乐。购时尚网Q Q: 8-7-6-931865买的,推荐你看看。txd
1