洗洁精用表面活性剂:急----请问下谁有ASP查询系统的东西我出200 如数据库或者ASP建模
?????????/代码呢?
请问你要哪方面的??
先给你:ASP图书馆查询系统 剩下的由此引申制作!!
这个程序完整!
<script language="vbscript">
<!--
Function datacheck
dim errflag
errflag = True
'表单(Form)的名称为「qrybk」,同时检查「书籍编号」、「作
'者姓名」、「出版年月」及「书名关键字」是否为「空字符串」
If (qrybk.bookno.value = Empty) And _
(qrybk.author.value = Empty) And _
(qrybk.pub_date.value = Empty) And _
(qrybk.bookname.value = Empty) Then
'将游标置于表单的第一个栏,即「书籍编号」
focusto(0)
errflag = False
End if
If (errflag = False) then
'利用MsgBox程序显示警告讯息
MsgBox "请至少输入一项查询条件!", 64, "Oh no!"
Exit Function
End if
datacheck = errflag
'Submit(传送)表单资料至Web Server
qrybk.Submit
End Function
Sub focusto(x)
'将游标定位于某个栏
document.qrybk.elements(x).focus()
End Sub
-->
</script>
<script Language="VBScript" RunAt="Server">
Function adjust_sql(adj_str)
'目的:转换查询串字符中的特殊字符至SQL指令
Dim final_str, i
'
adj_str = Trim(adj_str)
final_str = ""
'每次从传进来的字符串中取出一个字符,并判断是否为下述三个
'字符之一:左中括号"["、DOS的Filter符号"|"以及单引号"'"
If Len(adj_str) > 0 Then
For i = 1 To Len(adj_str)
Select Case Mid(adj_str, i, 1)
Case "[":
final_str = final_str & "[[]"
Case "|":
final_str = final_str & "[{-}]"
Case "'":
final_str = final_str & "[&-(]"
Case Else: '以上皆非则什麽事都不做
final_str = final_str & Mid(adj_str, i, 1)
End Select
Next
End If
adjust_sql = final_str
End Function
Sub Parse_text(m_output)
'上一次位置、目前累计长度、实际位置、总长度
Dim old_pos, tmp_Len, i, tot_Len
'
old_pos = 0
tmp_Len = 0 '记录逻辑上的长度
tot_Len = Len(Trim(m_output))
'i代表字符串中实际的位置
For i = 1 To tot_Len
'若为中文
If Len(Hex(Asc(Mid(m_output, i, 1)))) > 2 Then
'将长度加2
tmp_Len = tmp_Len + 2
Else
'否则加1
tmp_Len = tmp_Len + 1
End If
'如果大於等于78个字符,准备输出结果
If tmp_Len >= 72 Then
Response.Write Mid(m_output, old_pos + 1, i - old_pos)
Response.Write "<br>"
'还原计数值
old_pos = i
tmp_Len = 0
End If
Next
'将其余的字符(如果还有的话)一并输出
If tmp_Len > 0 Then
Response.Write Mid(m_output, old_pos + 1, tot_Len - old_pos)
End If
End Sub
</script>
<html>
<head>
<title>比艾思在线图书馆</title>
</head>
<body background="marble2c.jpg">
<%
'判断bookno、author、pub_date及bookname是否全为空白
If Request("bookno") = Empty And _
Request("author") = Empty And _
Request("pub_date") = Empty And _
Request("bookname") = Empty Then
%>
<center>
<font size="+3">~比艾思在线图书馆~</font>
<hr>
<font size="4">请至少输入一项查询条件,谢谢!</font>
</center>
<form action="default.asp" method="post" name="qrybk">
<table border=0 align=center width=600>
<TR>
<TD>
<IMG height=14 src="redball.gif" width=14>书籍编号:<input name="bookno" size="7"><p>
<IMG height=14 src="redball.gif" width=14>作者姓名:
<select name="author">
<option value="" selected>-----</option>
<option value="许耀豪">许耀豪</option>
<option value="林宏谕">林宏谕</option>
<option value="黄燕忠">黄燕忠</option>
<option value="廖信彦">廖信彦</option>
<option value="林敏惠">林敏惠</option>
<option value="陈周造">陈周造</option>
</select>
<p>
<IMG height=14 src="redball.gif" width=14>出版年月:<input name="pub_date" size="6">(范例:200101)<p>
<IMG height=14 src="redball.gif" width=14>书名关键字:<input name="bookname" size="50"><p>
<hr>
<input type="button" value="开始查询" onclick="datacheck" id=button1 name=button1>
<input type="reset" value="重新选择" id=reset1 name=reset1><p>
</TD>
</TR>
</TABLE>
</form>
<%
Else
Dim bookno, author, pub_date, bookname
'指定条件栏总数、通用字符、SQL字符串
Dim cond_count, wc, SQLstr
'记录指定条件的栏总数
cond_count = 4
'指定SQL指令中的通用字符,SQL Server 6.5里头用的符号是
'百分比(%),Access 97则是星号(*)
wc = "%"
'取得表单栏内容
bookno = Request.Form("bookno")
author = Request.Form("author")
pub_date = Request.Form("pub_date")
bookname = Request.Form("bookname")
'调整SQL指令中的特定字符
bookno = adjust_sql(bookno)
author = adjust_sql(author)
pub_date = adjust_sql(pub_date)
bookname = adjust_sql(bookname)
'
If Len(bookno) = 0 Then cond_count = cond_count - 1
If Len(author) = 0 Then cond_count = cond_count - 1
If Len(pub_date) = 0 Then cond_count = cond_count - 1
If Len(bookname) = 0 Then cond_count = cond_count - 1
'
SQLstr = "select * from book where "
'请留意bookno两端添加的通用字符,SQL Server 6.5里头
'用的符号是百分比(%),Access 97则是星号(*)。
If Len(bookno) > 0 Then
'省略adjust_field(bookno),因为不需要调整中文字符串
SQLstr = SQLstr & " bookno like '" & wc & bookno & wc & "'"
If cond_count > 1 Then
SQLstr = SQLstr & " and "
cond_count = cond_count - 1
End If
End If
If Len(author) > 0 Then
SQLstr = SQLstr & " author like '" & wc & author & wc & "'"
If cond_count > 1 Then
SQLstr = SQLstr & " and "
cond_count = cond_count - 1
End If
End If
If Len(pub_date) > 0 Then
SQLstr = SQLstr & " pub_date like '" & wc & pub_date & wc & "'"
If cond_count > 1 Then
SQLstr = SQLstr & " and "
cond_count = cond_count - 1
End If
End If
If Len(bookname) > 0 Then
SQLstr = SQLstr & " bookname like '" & wc & bookname & wc & "'"
End If
SQLstr = SQLstr & " order by bookno"
'建立ADO Connection,然后以DSN-less之方式登入到SQL Server
set adocon=Server.CreateObject("ADODB.Connection")
'adocon.Open "Driver={SQL Server};Server=ALVINNT4;UID=sa;PWD=;database=pubs"
adocon.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE= " & server.MapPath("book.mdb")
'执行SQL指令,并将结果储存于Recordset中
set sa1 = adocon.Execute(SQLstr)
If sa1.EOF Then
Response.Write "<br><center><h1>"
Response.Write "<hr>Sorry ~~~<p>"
Response.Write "没有任何符合条件的书籍资料,<br>"
Response.Write "请重试一次!</center><p>"
Response.Write "<hr></h1>"
Else
i = 0
Response.Write "<center><h2>"
Response.Write "符合条件的书籍资料如下:"
Response.Write "</center></h2><hr>"
Response.Write "<table border=1 align=center width=600>"
While Not sa1.EOF
i = i + 1
Response.Write "<tr>"
Response.Write "<td>"
Response.Write "资料笔数:" & i & "<br>"
Response.Write "书籍编号: <a href='" & sa1("bookno") & ".htm' target='_blank'>" & sa1("bookno") & "</a><br>"
Response.Write "作 者:" & sa1("author") & "<br>"
Response.Write "书 名:" & sa1("bookname") & "<br>"
Response.Write "摘 要:<br>"
If Not IsNull(sa1("abstract")) Then Parse_text(sa1("abstract"))
Response.Write "</td>"
Response.Write "</tr>"
sa1.MoveNext
WEnd
adocon.Close
Response.Write "</table>"
Response.Write "<center><h2>符合条件的书籍资料共有:"
Response.Write i & "笔。<br>"
Response.Write "</h2></center>"
End If
End If %>
</body>
</html>
我有!
你要什么方面的查询系统???
先给你:ASP图书馆查询系统
<script language="vbscript">
<!--
Function datacheck
dim errflag
errflag = True
'表单(Form)的名称为「qrybk」,同时检查「书籍编号」、「作
'者姓名」、「出版年月」及「书名关键字」是否为「空字符串」
If (qrybk.bookno.value = Empty) And _
(qrybk.author.value = Empty) And _
(qrybk.pub_date.value = Empty) And _
(qrybk.bookname.value = Empty) Then
'将游标置于表单的第一个栏,即「书籍编号」
focusto(0)
errflag = False
End if
If (errflag = False) then
'利用MsgBox程序显示警告讯息
MsgBox "请至少输入一项查询条件!", 64, "Oh no!"
Exit Function
End if