delthebtorcotnewrongfiles.asp

来自「绿叶oa系统办公自动化 2008.工作日志管理,文件管理」· ASP 代码 · 共 125 行

ASP
125
字号

<%
Dim thewrongfiels__u
thewrongfiels__u = "1"
If (Session("userssdfgfhtrh") <> "") Then 
  thewrongfiels__u = Session("userssdfgfhtrh")
End If
%>
<%
Dim thewrongfiels
Dim thewrongfiels_numRows

Set thewrongfiels = Server.CreateObject("ADODB.Recordset")
thewrongfiels.ActiveConnection = MM_oavbsconn_STRING
thewrongfiels.Source = "SELECT 文件路径  FROM 通知附件db  WHERE ok = '否' and 发送人帐号='" + Replace(thewrongfiels__u, "'", "''") + "'"
thewrongfiels.CursorType = 0
thewrongfiels.CursorLocation = 2
thewrongfiels.LockType = 1
thewrongfiels.Open()
thewrongfiels_numRows = 0
%>

<%if not thewrongfiels.eof or not thewrongfiels.bof then %>


<%
'  *** Recordset Stats, Move To Record, and Go To Record: declare stats variables

Dim thewrongfiels_total
Dim thewrongfiels_first
Dim thewrongfiels_last

' set the record count
thewrongfiels_total = thewrongfiels.RecordCount

' set the number of rows displayed on this page
If (thewrongfiels_numRows < 0) Then
  thewrongfiels_numRows = thewrongfiels_total
Elseif (thewrongfiels_numRows = 0) Then
  thewrongfiels_numRows = 1
End If

' set the first and last displayed record
thewrongfiels_first = 1
thewrongfiels_last  = thewrongfiels_first + thewrongfiels_numRows - 1

' if we have the correct record count, check the other stats
If (thewrongfiels_total <> -1) Then
  If (thewrongfiels_first > thewrongfiels_total) Then
    thewrongfiels_first = thewrongfiels_total
  End If
  If (thewrongfiels_last > thewrongfiels_total) Then
    thewrongfiels_last = thewrongfiels_total
  End If
  If (thewrongfiels_numRows > thewrongfiels_total) Then
    thewrongfiels_numRows = thewrongfiels_total
  End If
End If
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count them

If (thewrongfiels_total = -1) Then

  ' count the total records by iterating through the recordset
  thewrongfiels_total=0
  While (Not thewrongfiels.EOF)
    thewrongfiels_total = thewrongfiels_total + 1
    thewrongfiels.MoveNext
  Wend

  ' reset the cursor to the beginning
  If (thewrongfiels.CursorType > 0) Then
    thewrongfiels.MoveFirst
  Else
    thewrongfiels.Requery
  End If

  ' set the number of rows displayed on this page
  If (thewrongfiels_numRows < 0 Or thewrongfiels_numRows > thewrongfiels_total) Then
    thewrongfiels_numRows = thewrongfiels_total
  End If

  ' set the first and last displayed record
  thewrongfiels_first = 1
  thewrongfiels_last = thewrongfiels_first + thewrongfiels_numRows - 1
  
  If (thewrongfiels_first > thewrongfiels_total) Then
    thewrongfiels_first = thewrongfiels_total
  End If
  If (thewrongfiels_last > thewrongfiels_total) Then
    thewrongfiels_last = thewrongfiels_total
  End If

End If
%>
<%
dim filestaoll,filespath
  Dim objFSO  
  Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
   for i =1 to thewrongfiels_total
   filespath="../"&thewrongfiels("文件路径")
   response.write  filespath
   
If objFSO.FileExists(Server.MapPath(filespath)) Then
objFSO.DeleteFile Server.MapPath(filespath),True
end if
thewrongfiels.movenext
next

if(Session("userssdfgfhtrh") <> "") then Command1__u = Session("userssdfgfhtrh")

set Command1 = Server.CreateObject("ADODB.Command")
Command1.ActiveConnection = MM_oavbsconn_STRING
Command1.CommandText = "DELETE FROM 通知附件db  WHERE ok='否' and 发送人帐号='" + Replace(Command1__u, "'", "''") + "' "
Command1.CommandType = 1
Command1.CommandTimeout = 0
Command1.Prepared = true
Command1.Execute()

end if
%>


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?