28,409
社区成员




str_sqlSelect = "select * from usr where usrnam like '%"&text1.value&"%'"
str_sqlSelect = "select * from usr where 1=1"
If text1<>"" Then
str_sqlSelect = str_sqlSelect &" And usrnam like '%"&text1&"%'"
End If
<script type="text/javascript">
function chaxun(){
window.href("search.asp?text1='+text1+'");
}
</script>
<input type="text" id="text1" name="text1" value="" />
text1 = Trim(request("text1"))
<%
dim str_dataConn
set str_dataConn = server.createObject("adodb.connection")
str_dataConn.open "driver={SQL Server};server=.\SQLEXPRESS;uid=sa;pwd=123456789;database=UserInfo"
%>
<html>
<head>
<style type="text/css">
.td_line_col_FFFFFF {
border: 1px black solid;
}
</style>
</head>
<body>
<%
oAction = Trim(Request("oAction"))
Select Case oAction
Case "list"
Call list()
Case Else
Call list()
End Select
Sub list()
%>
<table width="966" border="0" align="center" cellpadding="0" cellspacing="0">
<form action="" method="post">
<tr>
<td><input type="text" id="text1" name="text1" value="" />
<input type="submit" value="查询"/></td>
</tr>
</form>
<%
text1 = Trim(request("text1"))
dim rs_sqlSelect
dim str_sqlSelect
set rs_sqlSelect = server.createObject("adodb.recordset")
str_sqlSelect = "select * from usr where 1=1"
If text1<>"" Then
str_sqlSelect = str_sqlSelect &" And usrnam like '%"&text1&"%'"
End If
rs_sqlSelect.open str_sqlSelect, str_dataConn, 1, 1
do while not rs_sqlSelect.eof
i=0
%>
<tr>
<td height="30" align="center" class="td_line_col_FFFFFF"><%=rs_sqlSelect("usrrnm")%></td>
<td height="30" align="center" class="td_line_col_FFFFFF"><%=rs_sqlSelect("usrdnm")%></td>
<td height="30" align="center" class="td_line_col_FFFFFF"><%=rs_sqlSelect("usrdcd")%></td>
<td height="30" align="center" class="td_line_col_FFFFFF"><%=rs_sqlSelect("usrbtd")%></td>
</tr>
<%
i=i+1
rs_sqlSelect.MoveNext
loop
rs_sqlSelect.close
set rs_sqlSelect = nothing
set str_dataConn = nothing
%>
</table>
<%
End Sub
%>
</body>
</html>
window.href('search.asp?text1='+sd+'');
str_sqlSelect = str_sqlSelect &" And usrnam like '%"&name&"%'"
str_sqlSelect = str_sqlSelect &" And usrnam like '%"&text1&"%'"
function chaxun(){
window.href("search.asp?name='+text1+'");
}
function chaxun(){
var sd = document.getElementById('text1').value;
window.href("search.asp?text1="+sd+"");
}