Recommended: ASP click to refresh the verification code instance code Most of the verification codes on the website are picture verification codes, just like the one below http://dwww.cn/Books.asp. Users may stay on the page for a long time, and the verification code may expire when the last submission is finally submitted. So you need to add a refresh function. Verification code: input name='checkimg' type='text' class='input' id='che
1.Return the stored procedure of the total number of records sets:
CREATE procedure dbo.recordCount
(
@TableName nvarchar(100),--database table name
@strWhere nvarchar(500),--Query Conditions
@count int output---Output value, total number of records
)
as
declare @sqlStr nvarchar(1000)
if @strWhere != ''
set @sqlStr = N'select @COUNT = count(id) from '+ @TableName +' where 1=1 ' + @strWhere
else
set @sqlStr = N'select @COUNT = count(id) from '+ @TableName
exec sp_executesql @sqlStr,N'@count int output',@count output
GO
2. SQL2000 stored procedure pagination, this is also found online. If there is an error, I modified it myself.
CREATE PROCEDURE dbo.sp_pageview
@tablename varchar(200) , --table name
@strGetFields varchar(200), --Query column name
@PageIndex int , --page number
@pageSize int, --page size
@strWhere varchar(100) , --Query criteria
@strOrder varchar(100) , --Sorting column name
@intOrder bit -- Sort type 1 is ascending
AS
Begin
declare @strSql varchar(500) --Subject statement
declare @strTemp varchar(100) --temporary variable
declare @strOrders varchar(50) --Sorting statement
declare @table varchar(70)
if @intOrder = 0
Begin
--As 0 is ascending order
set @strTemp = '>(select max'
set @strOrders = ' order by '+@strOrder+' asc '
end
else
Begin
-- Otherwise it is descending order
set @strTemp = '<(select min'
set @strOrders = ' order by '+@strOrder+' desc '
end
if @PageIndex =1 --Read the record directly on the first page
Begin
if @strWhere = ''
Begin
set @strSql = 'select top '+str(@pageSize)+' '+@strGetFields+' from '+@tablename+' '+@strOrders
end
else
Begin
set @strSql = 'select top '+str(@pageSize)+' '+@strGetFields+ ' from '+@tablename+' where '+@strWhere+' '+@strOrders
Share: ASP realizes the rotary display of js images In the afternoon, I made an asp+js to achieve the effect of the image rotation. The effect picture is as follows: The image rotation on the left is, I used js, and then I changed it to use asp to achieve the effect. pic.asp source code: % 'Connect database code saves sql=(select * from Pic order by picorder asc,id desc) Set rs=server.CreateObject(
4 pages in total Previous page 1234Next page