</tr>
<tr bgcolor="#CCCEEE">
<td nowrap><div align="center"><font color="#990000">拉丁名称:</font></div></td>
<td nowrap>
<%response.Write(records("latinname"))%>
</td>
</tr>
<tr bgcolor="#DDDEEE">
<td nowrap><div align="center"><font color="#990000" >中文名称:</font></div></td>
<td nowrap>
<%response.Write(records("chinesename"))%>
</td>
</tr>
<tr bgcolor="#CCCEEE">
<td nowrap><div align="center"><font color="#990000">相关描述:</font></div></td>
<td nowrap>
<%response.Write(records("miaoshu"))%>
</td>
</tr>
</table>
<div align="center"><br>
<a href="java script:history.back(1)">【返回】</a><br>
由于采用了B/S模式,使得整个系统大在的减少了工作量。图4.4显示了B/S模式
图5 B/S模式原理图
的工作原理。在前端采用IE、Netscape等的浏览器将用户提交的操作信息向Web服务器发出HTTP请求,Web服务器通过ASP和一些中间组件访问后台数据库,并将操作结果以HTML页面的形式返回给前端浏览器。
4.5 利用ASP进行动态数据查询
为了将从数据库中获得的数据显示在客户端浏览器中,需要在ASP文件中加入Table对象。Table对象可以用来显示从Server端数据库中通过SQL查询得到的记录。使用Dreamweaver等可视化工具可以方便地对*.ASP文件进行用户界面的设计。包括添加Table对象、动态GIF文件等。以下是本网页中的一段查询代码:
<%
word=request(trim("Keyword"))
set records=server.CreateObject("ADODB.recordset")
if request("select2")="精确" then
if request("select1")="科" then
sql="select * from kebiao where keID ='"&word&"' or chinesename='"&word&"' or latinname='"&word&"'"
elseif request("select1")="属" then
sql="select * from shubiao where shuID ='"&word&"' or chinesename='"&word&"' or latinname='"&word&"'"
elseif request("select1")="种" then
sql="select * from zhongbiao where zhongID ='"&word&"' or chinesename='"&word&"' or latinname='"&word&"'"
elseif request("select1")="标本" then
sql="select * from specimenbiao where biaoID ='"&word&"' or chinesename='"&word&"' or latinname='"&word&"'"
end if
if err.number <> 0 then
response.write "数据库操作失败:"&err.description
end if
elseif request("select2")="模糊" then
if request("select1")="科" then
sql="select * from kebiao where keID like '%"&word&"%' or chinesename like '%"&word&"%' or l