📄 searchcustom.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Connections/conn.asp" -->
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "1"
If (Request.Form("textfield") <> "") Then
Recordset1__MMColParam = Request.Form("textfield")
End If
%>
<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_conn_STRING
Recordset1.Source = "SELECT * FROM Customers WHERE CustomerID = '" + Replace(Recordset1__MMColParam, "'", "''") + "'"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>通过查询创建记录集实例</title>
</head>
<body>
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="150">
<div align="center">客户编号</div></td>
<td width="150">
<div align="center">客户姓名</div></td>
<td width="150">
<div align="center">电话</div></td>
<td width="150">
<div align="center">电子邮件</div></td>
</tr>
<tr>
<td> <% If Not Recordset1.EOF Or Not Recordset1.BOF Then %>
<div align="center"><%=(Recordset1.Fields.Item("CustomerID").Value)%> </div>
<% End If ' end Not Recordset1.EOF Or NOT Recordset1.BOF %> </td>
<td> <% If Not Recordset1.EOF Or Not Recordset1.BOF Then %>
<div align="center"><%=(Recordset1.Fields.Item("CustomerName").Value)%> </div>
<% End If ' end Not Recordset1.EOF Or NOT Recordset1.BOF %> </td>
<td> <% If Not Recordset1.EOF Or Not Recordset1.BOF Then %>
<div align="center"><%=(Recordset1.Fields.Item("Phone").Value)%> </div>
<% End If ' end Not Recordset1.EOF Or NOT Recordset1.BOF %> </td>
<td> <% If Not Recordset1.EOF Or Not Recordset1.BOF Then %>
<div align="center"><%=(Recordset1.Fields.Item("E-MAIL").Value)%> </div>
<% End If ' end Not Recordset1.EOF Or NOT Recordset1.BOF %> </td>
</tr>
</table>
<hr>
<% If Recordset1.EOF And Recordset1.BOF Then %>
<p align="center"><strong>找不到相关记录</strong></p>
<% End If ' end Recordset1.EOF And Recordset1.BOF %>
<form name="form1" method="post" action="">
<div align="center">客户编号:
<input type="text" name="textfield">
<input type="submit" name="Submit" value="提交">
</div>
</form>
<p> </p>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -