答案:'SPString.SQL
if exists (select name from sysobjects where name = 'SPROCString')
drop proc SPROCString
GO
CREATE PROCEDURE SPROCString
@pTitle varchar(80)
AS
SET NOCOUNT ON
SELECT
*
FROM
TitleView
WHERE
Title = @pTitle
or @pTitle = '*'
'易做图.asp
<%
' 05/02/98
' Added the following features:
' Tab Query String Parameter
' - This is the selected tab's tabArray index value.
' Page Expiry Time
' - The page will expire when downloaded by browser so that user is insured that all data
' will be current.
' DrillDown Tabs
' - Added in the session("tabArray") object to keep track of the drill down tabs.
' Search
' - Added javascript window.alert function call to indicate when text is not found in rpt view.
' Goto Page Text Box
' - Added textbox and filenew.gif so user can enter and request desired page number.
' NOTE: Netscape 2.0 browsers do not call the on submit event handler when the image is selected.
' Thus, the user will not be warned when incorrect data is entered into the goto page box.
' This problem does not happen when the user selects return.
Response.Expires = 0
' Viewer Tab images
drilld = "<img border=0 src='http://old.zzzyk.com/viewer/images/易做图/pdrilld.gif' alt = 'Parent Group'>"
drillu = "<img border=0 src='http://old.zzzyk.com/viewer/images/易做图/cdrillu.gif' alt = 'Current Group'>"
previewu = "<img border=0 src='http://old.zzzyk.com/viewer/images/易做图/pviewu.gif' alt = 'Preview'>"
previewd = "<img border=0 src='http://old.zzzyk.com/viewer/images/易做图/pviewd.gif' alt = 'Preview'>"
' Set the correct numbers on the paging buttons
brch = request.querystring("BRCH")
if brch <> "" then
brch = "&" & "brch=" & brch
basepage = "<a href=>
end if
getPageCommand = "rptserver.asp?cmd=易做图%5Fpage&viewer=html%5Fframe&vfmt=html%5Fframe" & brch
searchFound = request.querystring("SEARCHFOUND")
if searchFound <> "" then
if Cint(searchFound) = 0 then
messageText = "onLoad = " & chr(34) & "window.alert('Text Not Found in the Report');" & chr(34)
end if
end if
CurrentPageNumber = CStr(session("CurrentPageNumber"))
lastknownpage = CStr(session("lastknownpage"))
LastPageNumber = CStr(session("LastPageNumber"))
if CurrentPageNumber = "" then
CurrentPageNumber = "1"
end if
if lastknownpage = "" then
lastknownpage = "0"
end if
if LastPageNumber <> "" and (CurrentPageNumber = LastPageNumber) then
lastknownpage = CurrentPageNumber
' remember the last known page
session("lastknownpage") = CurrentPageNumber
nextlink = ""
lastlink = ""
if CInt(CurrentPageNumber) > 1 then
previouspage = CInt(CurrentPageNumber) - 1
previouslink = "<a href=> firstlink = "<a href=> else
previouslink = ""
firstlink = ""
end if
else
if (CInt(lastknownpage) < CInt(CurrentPageNumber)) and LastPageNumber = "" then
' remember the last known page
session("lastknownpage") = CurrentPageNumber
lastknownpage = CurrentPageNumber & "+"
else
if lastknownpage <> LastPageNumber then
lastknownpage = lastknownpage & "+"
end if
end if
if CInt(CurrentPageNumber) > 1 then
previouspage = CInt(CurrentPageNumber) -1
previouslink = "<a href=> firstlink = "<a href=> else
previouslink = ""
firstlink = ""
previouspage = 1
end if
nextpage = CInt(CurrentPageNumber) + 1
nextlink = "<a href=> lastlink = "<a href=>end if
%>
<html>
<script language="javascript">
function ValidateNumber(val, msg)
{
if (val == "")
{
alert("Please enter a value for the " + msg + " field.");
return (false);
}
var checkOK = "0123456789";
var checkStr = val;
var allValid = true;
var decPoints = 0;
var allNum = "";
for (i = 0; i < checkStr.length; i++)
{
ch = checkStr.charAt(i);
for (j = 0; j < checkOK.length; j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length)
{
allValid = false;
break;
}
allNum += ch;
}
if (!allValid)
{
alert("Please enter only digit characters in the " + msg + " field.");
return (false);
}
var chkVal = allNum;
var prsVal = parseInt(allNum);
if (chkVal != "" && !(prsVal >= "1"))
{
alert("Please enter a value greater than \"0\" in the " + msg + " field.");
return (false);
}
return (true);
}
var currentValue = "<% response.write CurrentPageNumber %>";
function checkValue(){
var pageNumber = document.forms[0].elements[0].value;
if(!ValidateNumber(pageNumber, "Goto Page Number")){
document.forms[0].elements[0].value = currentValue;
parent.status = "Please Enter a Positive Numeric Value. NO SPACES";
return false;
}
else
// a new page will be downloaded with the next page number
return true;
}
</script>
<body background="/viewer/images/易做图/toolbg.gif" topmargin=0 leftmargin=0 <% response.write messageText%>>
<form method="POST" name=getPg ta
上一个:ASP Call Crystal Report with Store Procedure(5)
下一个:ASP环境下邮件列表功能的实现 (三)(推荐)