|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
ASP最大的缺点在于网络的安全性和可靠性,企业将经营数据放在开放的平台上,最大的担忧就是如何保证这些数据不被其他人破坏。存储历程|分页|数据1、创立表tiku_koushi
ifexists(select*fromdbo.sysobjectswhereid=
object_id(N[dbo].[tiku_koushi])andOBJECTPROPERTY
(id,NIsUserTable)=1)
droptable[dbo].[tiku_koushi]
GO
CREATETABLE[dbo].[tiku_koushi](
[id][int]IDENTITY(1,1)NOTNULL,
[title][varchar](250)COLLATE
Chinese_PRC_CI_ASNULL,
[list2_id][char](10)COLLATE
Chinese_PRC_CI_ASNULL
)ON[PRIMARY]
GO
2、存储历程sp_c
CREATEprocsp_c
@tablenamevarchar(50),
@titlevarchar(250),
@list2_idvarchar(50)
as
if@tablename=tiku_koushi
selectcount(*)fromtiku_koushiwheretitlelike%+@title+%andlist2_id=@list2_id
GO
3、存储历程sp_search_tiku
CREATEPROCEDUREsp_search_tiku
@tablenamevarchar(50),
@titlevarchar(250),
@list2_idvarchar(10),
@pagesizeint,
@pageint
AS
if@tablename=tiku_koushi
begin
declare@ksint
declare@strvarchar(200)
set@ks=@pagesize*(@page-1)
ifnotexists(select*fromdbo.sysobjectswhereid=object_id(N[dbo].[temp_table91])andOBJECTPROPERTY(id,NIsUserTable)=1)
begin
select*intotemp_table91fromtiku_koushiwhere
titlelike%+@title+%andlist2_id=@list2_idorder
byiddesc
setrowcount@pagesize
set@str=select*fromtemp_table91whereidnotin
(selecttop+str(@ks)+idfromtemp_table91)
execute(@str)
droptabletemp_table91
end
end
GO
4、search_koushi.asp
<!--#includefile="conn.asp"-->
<%
line=6
ifrequest("page")=""then
page=1
else
page=request("page")
endif
ifpage<1then
page=1
endif
title=trim(request("title"))
list2_id=trim(request("list2_id"))
setrs2=conn.execute("sp_ctiku_koushi,"&title&","&list2_id&"")
pagecount=CInt(rs2(0)line)
if(CInt(rs2(0))modline)=0then
pagecount=pagecount
else
pagecount=pagecount+1
endif
ifCInt(page)>=pagecountthen
page=CInt(pagecount)
endif
str=""
str=str&"page="&page&"&title="&title&"&list2_id="&list2_id
setrs=conn.execute
("sp_search_tikutiku_koushi,"&title&","&list2_id&","&line&","&CInt(page)&"")
ifrs.eofthen
response.write"norecord"
else
%>
<html>
<head>
<styletype="text/CSS">
td{font-size:12px;}
a{text-decoration:none;}
</style>
<scriptlanguage="javascript">
</script>
</head>
<body>
<tablewidth="518"border="1"bordercolorlight="000000"
bordercolordark="#ffffff"
align="center"cellpadding="0"cellspacing="0">
<!--DWLayoutTable-->
<trbgcolor=#dfdfdf>
<tdwidth="454"align="center"height=24valign="middle">笔试题的标题</td>
<tdwidth="63"align="center"valign="middle">删除</td>
</tr>
<%dountilrs.eof%>
<trheight=22>
<tdvalign="middle">・<ahref=void(0)"
id")%>&page=<%=page%>&title=<%=title%>&list2_id=<%=list2_id%>,,width=518
height=160left=100)">
<%=rs("title")%></a></td>
<tdalign="center"valign="middle">删除</td>
</tr>
<%
rs.movenext
loop
%>
<tralign="left"valign="middle"bgcolor="efeff6"
height=22>
<tdcolspan="2"style="padding-left:6px;">
<ahref="search_koushi.asp?page=<%=1%>&title=<%=title%>&list2_id=<%=list2_id%>">首页</a> <a
href="search_koushi.asp?page=<%=page-1%>&title=<%=title%>&list2_id=<%=list2_id%>">上一页</a> <a
href="search_koushi.asp?page=<%=page+1%>&title=<%=title%>&list2_id=<%=list2_id%>">下一页</a> <a
href="search_koushi.asp?page=<%=pagecount%>&title=<%=title%>&list2_id=<%=list2_id%>">末页</a>
一共<%=pagecount%>页 以后页为:<%=page%>/<%=pagecount%>页
共有<%=rs2(0)%>笔记录</td>
</tr>
</table>
</body>
</html>
<%
rs2.close
setrs2=nothing
rs.close
setrs=nothing
endif
%>
</p>对用户来说可预见费用、节约费用,可以做到花少钱办大事。由于省去了购买软件和硬件等的前期费用,用户可以租用较高级的应用软件。ASP的收费是根据软件的类型、客制化程度、用户数量、服务期限来定的,对客户来说这笔费用是可以预见的。方便于客户应用软件的升级。 |
|