盾怪网教程:是一个免费提供流行杀毒软件教程、在线学习分享的学习平台!

一个比较实用的asp函数集合类

时间:2024/11/30作者:未知来源:盾怪网教程人气:

[摘要]shell" End Sub Private Sub Class_terminate() If IsObject(rsDivPage) Then rsDivPage.Close:Set...
shell"
 End Sub
 
 Private Sub Class_terminate()
  If IsObject(rsDivPage) Then rsDivPage.Close:Set rsDivPage=Nothing
  If IsObject(objConn) Then objConn.Close:Set objConn=Nothing
 End Sub

 Public Property Get Version
  Version="DSJ 1.1.0 Beta"
 End Property
 
 Public Property Get Error
  Error=p_Error
 End Property
 
 Public Property Get Debug
  Debug=p_Debug
 End Property
 Public Property Let Debug(BoolDebug)
  If BoolDebug Then
   p_Debug=True
  Else
   p_Debug=False
  End If
 End Property
 
 Public Property Get dbType
  dbType=p_dbType
 End Property
 Public Property Let dbType(lngdbType)
  If IsNumeric(lngdbType) Then
   p_dbType=lngdbType
  Else
   p_dbType=12
  End If
 End Property
 
 Public Property Get dbFolder
  dbFolder=p_dbFolder
 End Property
 Public Property Let dbFolder(strFolder)
  If Right(strFolder,1)="\" OR Right(strFolder,1)="/" Then
   p_dbFolder=strFolder
  Else
   If (NOT IsNull(strFolder)) OR (strFolder<>"") Then
    p_dbFolder=strFolder & "\"
   Else
    p_dbFoler=""
   End If
  End If
 End Property
 
 Public Property Get Database
  Database=p_dataBase
 End Property
 Public Property Let Database(strDataBase)
  p_dataBase=strDatabase
 End Property
 
 Public Property Get dbUserID
  dbUserID=p_dbUserID
 End Property
 Public Property Let dbUserID(strDataBaseUserID)
  p_dbUserID=strDataBaseUserID
 End Property
 
 Public Property Get dbPassword
  dbPassword=p_dbPassword
 End Property
 Public Property Let dbPassword(strDataBasePassword)
  p_dbPassword=strDataBasePassword
 End Property
 
 Public Property Get SQLDataSource
  SQLDataSource=p_sqlDataSource
 End Property
 Public Property Let SQLDataSource(strSQLDataSource)
  If strsqlDataSource<>"" Then
   If Left(p_dbType,1)=2 Then
    p_sqlDataSource=strSQLDataSource
   Else
    AddErrorCode(110)
    p_sqlDataSource=""
   End If
  End If
 End Property
 
 Public Property Let PageSize(int_PageSize)
  If IsNumeric(Int_Pagesize) Then
   p_rsPageSize=CLng(int_PageSize)
  End If
 End Property
 Public Property Get PageSize
  If p_rsPageSize="" or NOT IsNumeric(p_rsPageSize) Then
   PageSize=8    
  Else
   PageSize=p_rsPageSize
  End If
 End Property

 Public Property Get GetRs()
  If NOT Debug Then On Error Resume Next
  If NOT IsObject(objConn) Then ConnectionDataBase dbDataBase,dbUserID,dbPassword,dbType
  If NOT IsObject(rsDivPage) Then
   Set rsDivPage=Server.createobject("adodb.recordset")
   rsDivPage.Open GetSQL,objConn,1,1
   rsDivPage.PageSize=PageSize
   If not(rsDivPage.eof and rsDivPage.BOF) Then
    If p_intCurPage>rsDivPage.PageCount Then
     p_intCurPage=rsDivPage.PageCount
    End If
    rsDivPage.AbsolutePage=p_intCurPage
   End If
   If Err Then
    Err.Clear
    rsDivPage.Close
    Set rsDivPage=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
   Set GetRs=rsDivPage
  End If
 End Property
 
 Public Property Let GetSQL(str_sql)
  If str_sql<>"" Then
   p_GetSQL=str_sql
  Else
   AddErrorCode(111)
   If Debug Then ShowErrMsg()
   p_GetSQL="The Property of GetSQL is NULL."
  End If
 End Property
 Public Property Get GetSQl()
  GetSQL=p_GetSQL
 End Property

 
 '******************************
 '名称: gotTopic
 '参数:str,strlen
 '返回值:被限制后的字符串
 '创建时间:2005年3月3日
 '作用:限制被限制的字符串
 '******************************
 Public Function GotToPic(str,strlen)
  Rem 限制字符串显示长度在一定的范围内
  Dim i,StringLen,CharSize,EchoCharType
  StringLen=len(str)
  CharSize=0
  For i=1 to StringLen
   EchoCharType=Abs(Asc(Mid(str,i,1)))
   If EchoCharType>255 Then
    CharSize=CharSize+2
   Else
    CharSize=CharSize+1
   End If
   If CharSize>strlen Then
    gotTopic=Left(str,i) & "..."
    Exit For
   Else
    gotTopic=str & ""
   End If
  Next
 End Function
 
 '******************************
 '名称: ChkInvStr
 '参数:Str
 '返回值:True/False
 '创建时间:2005年5月2日
 '作用:检查参数是否有非法字符
 '******************************
 Public Function ChkInvStr(Str)
  Rem 定义需要过滤得非法字符
  Dim InvaildWord,inWords,i
  Str=CStr(Str)
  ChkInvStr=False
  If Len(Replace(p_InvaildWords,Chr(0),""))<1 Then
   AddErrorCode(103) 'invaildwords is null
   Exit Function
  Else
   If Instr(1,p_Invaildwords,"

关键词:一个比较实用的asp函数集合类




Copyright © 2012-2018 盾怪网教程(http://www.dunguai.com) .All Rights Reserved 网站地图 友情链接

免责声明:本站资源均来自互联网收集 如有侵犯到您利益的地方请及时联系管理删除,敬请见谅!

QQ:1006262270   邮箱:kfyvi376850063@126.com   手机版