⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frm数据清除.frm

📁 此为我2001年为东莞建发楦头开发的企业管理软件他们使用至今,望斑竹指教! 其他会员最好不要随意下载,需经斑竹同意或我本人同意,谢谢!
💻 FRM
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form frmdelete 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "数据删除...."
   ClientHeight    =   2220
   ClientLeft      =   2775
   ClientTop       =   3360
   ClientWidth     =   5535
   Icon            =   "Frm数据清除.frx":0000
   KeyPreview      =   -1  'True
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2220
   ScaleWidth      =   5535
   Begin VB.CommandButton cmdok 
      Caption         =   "开始删除&S"
      Height          =   375
      Left            =   1320
      TabIndex        =   6
      Top             =   1680
      Width           =   1215
   End
   Begin VB.CommandButton cmdcancel 
      Caption         =   "关闭&C"
      Height          =   375
      Left            =   3120
      TabIndex        =   5
      Top             =   1680
      Width           =   1215
   End
   Begin VB.Frame Frame1 
      Caption         =   "选项"
      Height          =   1455
      Left            =   240
      TabIndex        =   0
      Top             =   120
      Width           =   5175
      Begin MSComCtl2.DTPicker DTP2 
         Height          =   375
         Left            =   3240
         TabIndex        =   1
         Top             =   840
         Width           =   1455
         _ExtentX        =   2566
         _ExtentY        =   661
         _Version        =   393216
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         CalendarForeColor=   16711680
         CalendarTitleBackColor=   255
         Format          =   61538305
         CurrentDate     =   36400
      End
      Begin MSComCtl2.DTPicker DTP1 
         Height          =   375
         Left            =   840
         TabIndex        =   2
         Top             =   840
         Width           =   1575
         _ExtentX        =   2778
         _ExtentY        =   661
         _Version        =   393216
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         CalendarForeColor=   16711680
         CalendarTitleBackColor=   255
         Format          =   61538305
         CurrentDate     =   36400
      End
      Begin VB.Label lbl 
         Caption         =   "到:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H000000FF&
         Height          =   255
         Index           =   0
         Left            =   2640
         TabIndex        =   4
         Top             =   840
         Width           =   375
      End
      Begin VB.Label lbl1 
         Caption         =   "1.请选取需删除的订货日期:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H000000FF&
         Height          =   375
         Index           =   2
         Left            =   240
         TabIndex        =   3
         Top             =   360
         Width           =   3015
      End
   End
End
Attribute VB_Name = "frmdelete"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub cmdCancel_Click()
    Unload Me
End Sub

Private Sub cmdok_Click()
    
    value1 = MsgBox("清除后的数据不能恢复,确认吗?", vbQuestion + vbOKCancel, "提示信息")
    If value1 <> 1 Then Exit Sub
    
    db.Execute " delete  from sproduce1 where din_date>=" & "'" & DTP1.value & "'" & " and din_date<=" & "'" & DTP2.value & "'"
    db.Execute " delete  from sproduce2 where din_date>=" & "'" & DTP1.value & "'" & " and din_date<=" & "'" & DTP2.value & "'"
    db.Execute " delete  from din where din_date>=" & "'" & DTP1.value & "'" & " and din_date<=" & "'" & DTP2.value & "'"
    
    Dim checktb As Recordset
    Set checktb = New Recordset
    checktb.Open "select * from ti_mas  where din_date>=" & "'" & DTP1.value & "'" & " and din_date<=" & "'" & DTP2.value & "'", db, adOpenStatic, adLockOptimistic
    If checktb.RecordCount <> 0 Then
       For i = 1 To checktb.RecordCount
           db.Execute "delete from ti_detail where tino=" & "'" & Trim(checktb!tino) & "'"
           checktb.MoveNext
       Next
    End If
    db.Execute "delete * from ti_mas where din_date>=" & "'" & DTP1.value & "'" & " and din_date<=" & "'" & DTP2.value & "'"
   
   
    Set checktb = New Recordset
    checktb.Open "select * from tap  where din_date>=" & "'" & DTP1.value & "'" & " and din_date<=" & "'" & DTP2.value & "'", db, adOpenStatic, adLockOptimistic
    If checktb.RecordCount <> 0 Then
       For i = 1 To checktb.RecordCount
           db.Execute "delete  from tap_detail where dino=" & "'" & Trim(checktb!dino) & "'"
           checktb.MoveNext
       Next
    End If
    db.Execute "delete  from tap where din_date>=" & "'" & DTP1.value & "'" & " and din_date<=" & "'" & DTP2.value & "'"
   
   
    MsgBox "清除数据完毕!!!", vbInformation, "提示信息"
    Exit Sub
err:
    ShowError
End Sub


Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyEscape Then Unload Me
End Sub

Private Sub Form_Load()
    DTP1.value = Date - 30
    DTP2.value = Date
End Sub

Private Sub Form_Resize()
'On Error Resume Next
'Me.Top = 0
'Me.Left = 50
End Sub

⌨️ 快捷键说明

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