ASP函数库

减小字体 增大字体 作者:佚名  来源:本站整理  发布时间:2008-8-28 3:38:24 我要发布文章
namestr
  sfu_Rs.open sfu_sql_str,sfu_Conn,1,1
  If sfu_Rs.RecordCount >0 Then
     Do While Not sfu_Rs.Eof
        If (sfu_Rs(Tumc)=Cumc) AND (exmw(sfu_Rs(Tumm))=Cumm) Then
           CKUSMCMM=sfu_Rs(TUid)
           Exit Do
        End If
        sfu_Rs.MoveNext
     Loop
  End If
  sfu_Rs.Close
  sfu_Conn.Close
  Set sfu_Rs = Nothing
  Set sfu_Conn=Nothing
  On Error GoTo 0
End Function
'**************************************************
'函数ID:0049[生成时间的整数]
'函数名:GetMyTimeNumber()
'作 用:生成时间的整数
'参 数:lx  ---- 时间整数的类型
' lx=0 到分钟 lx=1 到小时 lx=2 到天 lx=3 到月
'返回值:生成时间的整数值(最小到分钟)
'示 例:
'**************************************************
Public Function GetMyTimeNumber(lx)
  If lx=0 Then GetMyTimeNumber=Year(Date)*12*30*24*60+Month(Date)*30*24*60+Day(Date)*24*60+Hour(Time)*60+Minute(Time)
  If lx=1 Then GetMyTimeNumber=Year(Date)*12*30*24+Month(Date)*30*24+Day(Date)*24+Hour(Time)
  If lx=2 Then GetMyTimeNumber=Year(Date)*12*30+Month(Date)*30+Day(Date)
  If lx=3 Then GetMyTimeNumber=Year(Date)*12+Month(Date)
End Function
'**************************************************
'函数ID:0050[获得栏目的所有子栏目字符串并用","隔开]
'函数名:GTLMfunLM
'作 用:获得栏目的所有子栏目字符串并用","隔开
'参 数:LMid          ---- 栏目代码
'参 数:ConnStrArray  ---- 栏目数据链接串
'返回值:子栏目字符串并用","隔开
'示 例:hh="数据表链接字串|父栏目字段名|栏目字段名|表名"
'示 例:GTLMfunLM(22,basicDB(3) & "|FTitId|TitId|TITS")
'**************************************************
Public Function GTLMfunLM(ByVal LMid,ByVal ConnStrArray)
  Dim LMstrxx,zdbz,Nlm
  zdbz=False
  LMstrxx=""
  aTempstr=GTLMfunLM_whil(LMid,ConnStrArray)
  LMstrxx=LMstrxx & aTempstr
  If InStrRev(aTempstr,",") > 0 Then
     Do While Not zdbz
        bTempstr=GTLMfunLM_Fj(aTempstr,ConnStrArray)
        LMstrxx=LMstrxx & bTempstr
        If bTempstr="" Then zdbz=True
        aTempstr=bTempstr
     Loop
  Else
     LMstrxx=aTempstr
  End If
  LMstrxx=Trim(LMstrxx)
  If LMstrxx<>"" Then If Mid(LMstrxx,Len(LMstrxx),1) = ","  Then LMstrxx=Mid(LMstrxx,1,Len(LMstrxx)-1)
  GTLMfunLM=LMstrxx
End Function
Public Function GTLMfunLM_whil(ByVal LMidstr,ByVal ConnStrArray)
  ppTemp=Split(ConnStrArray,"|")
  GTLMfunLM_whil=""
  Set telm_Conn=server.createobject("ADODB.Connection")
  Set telm_Rs  =server.createobject("ADODB.Recordset")
  telm_Conn.open ppTemp(0)
  telm_sql_str="SELECT " & ppTemp(1) & "," & ppTemp(2) & " FROM " & ppTemp(3) & " WHERE (" & ppTemp(1) & "='" & LMidstr & "')"
  telm_Rs.open telm_sql_str,telm_Conn,1,1
  If telm_Rs.RecordCount >0 Then
     Do While Not telm_Rs.Eof
        GTLMfunLM_whil=GTLMfunLM_whil & Trim(telm_Rs(ppTemp(2))) & ","
        telm_Rs.MoveNext
     Loop
  End If
  telm_Rs.Close
  telm_Conn.Close
  Set telm_Rs = Nothing
  Set telm_Conn=Nothing
End Function
Public Function GTLMfunLM_Fj(ByVal str,ByVal ConnStrArray)
  Dim templjid
  templjid=""
  If Trim(str)<>"" Then
     fjTemp=Split(str,",")
     For i = LBound(fjTemp) To UBound(fjTemp)
         If Trim(fjTemp(i))<>"" Then
            templjid=templjid & GTLMfunLM_whil(fjTemp(i),ConnStrArray)
         End If
     Next
  End If
  GTLMfunLM_Fj=templjid
End Function

%>
 

上一页  [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17]