If Err Then
Err.Clear
objConn.Close
Set objConn=Nothing
If SaveLog Then
tmpMsg="查询数据的时候发现错误,请检查您的查询代码是否正确。<br>基于安全的理由,只显示本信息,要查看详细的错误信息,请设置dsj.Debug=True"
Response.Write SaveSQLLog(cmd,tmpMsg)
Else
Response.Write "查询数据的时候发现错误,请检查您的查询代码是否正确。"
End If
Response.End()
End If
SQLQueryNum=SQLQueryNum 1
End Function
'******************************
'名称: HTMLEncode
'参数:fString
'返回值:HTMLEncode
'作用:对数据内容进行排版转换
'创建时间:2005年5月6日
'******************************
Public Function HTMLEncode(fString)
If Not IsNull(fString) Or fString<>"" Then
fString=Replace(fString,"<","<")
fString=Replace(fString,">",">")
fString=Replace(fString,Chr(9)," ") '倾斜字体
fString=Replace(fString,Chr(13),"")
fString=Replace(fString,Chr(32)," ") '转换空格
fString=Replace(fString,Chr(34),""") '转换双引号
fString=Replace(fString,Chr(39),"'") '转换单引号
fString=Replace(fString,Chr(10),"</p><p>") '转换成段落格式
fString=Replace(fString,Chr(10),"<BR> ") '转换为下一行
fString=Replace(fString,Chr(13),"<BR>")
fString=Replace(fSting,vbCrlf,"<BR>")
'fString=LinkFriend(fString)
'fString=ChkBadWords(fString)
HTMLEncode=fString
End If
End Function
'******************************
'名称: LinkFriend
'参数:fContent
'返回值:LinkFriend
'作用:进行友情连接替换
'创建时间:2005年5月6日
'******************************
Public Function LinkFriend(fContent)
If NOT p_Debug Then On Error Resume Next
If NOT IsObject(objConn) Then ConnectionDataBase DataBase,dbUserID,dbPassword,dbType
Set rsFriend=ExecuteCmd("Select Title,URL From dsj_FriendLink")
If rsFriend.Eof And rsFriend.Bof Then
Else
Do While NOT rsFriend.Eof
strTitle=rsFriend.Fields.Item("Title")
URl=rsFriend.Fields.Item("URL")
If LCase(Left(URL,1))<>"h" Then URL=Replace(URl,Left(URL,1),"")
strLink="<a target='_blank' title='" & strTitle &"' href='" & URL & "'>"
strLink=strLink&strTitle&"</a>"
If Instr(fContent,strTitle)>0 Then fContent=Replace(fContent,strTitle,strLink)
rsFriend.MoveNext
Loop
LinkFriend=fContent
End If
rsFriend.Close
Set rsFriend=Nothing
SQLQueryNum=SQLQueryNum 1
End Function
'***************************************************************
'名称: ShowPage
'参数:NULL
'返回值:NULL
'作用:显示经过分页后的记录导航
'说明:
' 原作:zykj2000 网站:http://bbs.513soft.net
' 修改:孤剑 网站:http://blog.csdn.net/alonesword/
'时间:2005年5月7日
'******************************************************************
Public Sub ShowPage()
Dim str_tmp
p_intTotalRecords=rsDivPage.RecordCount
If p_intTotalRecords<=0 Then
p_Error=p_Error & "总记录数为零,请输入数据"
Call ShowError()
End If
If p_intTotalRecords <=PageSize THen
p_intTotalPage=1
Else
If p_intTotalRecords mod PageSize =0 Then
p_intTotalPage = CLng(p_intTotalRecords / PageSize * -1)*-1
Else
p_intTotalPage = CLng(p_intTotalRecords / PageSize * -1)*-1 1
End If
End If
If p_intCurPage>p_intTotalPage Then
p_intCurPage=p_intTotalPage
End If
Response.Write ShowFirstPrv
showNumBtn
Response.Write ShowNextLast&" "
Response.Write ShowPageInfo
response.write str_tmp
End Sub
Private Function ShowFirstPrv()
Dim Str_tmp,int_prvpage
int_prvpage=p_intCurPage-1
If int_prvpage<1 Then int_prvpage=1
Btn_FirstLink="<a title='第1页' href='"&AddnPageURL&"1'>"&Btn_First
Btn_PrevLink="<a title='第"&int_prvpage&"页' href='"&AddnPageURL&p_intCurPage-1&"'>"&Btn_Prev
If p_intCurPage=1 Then
str_tmp=Btn_FirstLink&"</a> "&Btn_PrevLink&"</a> "
Else
int_prvpage=p_intCurPage-1
str_tmp=""&Btn_FirstLink&"</a> "& Btn_PrevLink&"</a> "
End If
ShowFirstPrv=str_tmp
End Function
Private Function ShowNextLast()
Dim str_tmp,int_Nextpage
int_NextPage=p_intCurPage 1
If p_intCurPage 1>p_intTotalPage Then int_NextPage=p_intTotalPage
Btn_NextLink="<a title='第"&int_NextPage&"页' href='"&AddnPageURL&p_intCurPage 1&"'>"&Btn_Next
Btn_LastLink="<a title='第"&p_intTotalPage&"页' href='"&AddnPageURL&p_intTotalPage&"'>"&Btn_Last
If p_intCurPage>=p_intTotalPage Then
str_tmp=Btn_NextLink & "</a> " & Btn_LastLink&"</a>"
Else
Int_NextPage=p_intCurPage 1
str_tmp=""&Btn_NextLink&"</a> "& Btn_LastLink&"</a>"
文章整理:西部数码--专业提供域名注册、虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!




