📄 delwg.frm
字号:
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc3"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSAdodcLib.Adodc Adodc2
Height = 375
Left = 3480
Top = 2160
Visible = 0 'False
Width = 2295
_ExtentX = 4048
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc2"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 3480
Top = 1800
Visible = 0 'False
Width = 2295
_ExtentX = 4048
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
End
Attribute VB_Name = "delwg"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
On Error Resume Next
Dim sql As String
Dim s As String
Dim panduan As Boolean
If Combo1.Text = "" And Text1.Text = "" And Text2.Text = "" Then
MsgBox "请输入删除条件!", , "提示"
Exit Sub
End If
s = Combo1.Text
If (MsgBox("你真的想删除日期为 " & Combo1.Text & " 公寓为 " & Text1.Text & " 寝室为 " & Text2.Text & " 姓名为 " & Text3.Text & " 的违规记录吗?", vbOKCancel, "系统提示")) = vbOK Then
Adodc1.Refresh
Adodc1.Recordset.ActiveConnection.Execute "delete from weigui where 日期='" & Trim(s) & "'and 公寓='" & Trim(Text1.Text) & "'and 寝室='" & Trim(Text2.Text) & "' and 姓名='" & Trim(Text3.Text) & "'" ', , adExecuteNoRecords
Adodc1.Recordset.Update
Combo1.Text = ""
Text1.Text = ""
Text2.Text = ""
MsgBox "删除成功", , "系统提示"
End If
Unload Me
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
On Error Resume Next
If (MsgBox("你真的想删除所有的记录吗?一旦删除即不可恢复", vbOKCancel, "系统提示")) = vbOK Then
For i = 1 To Adodc1.Recordset.RecordCount
Adodc1.Recordset.Delete
Adodc1.Recordset.MoveNext
Next i
End If
MsgBox "删除成功", , "系统提示"
Unload Me
End Sub
Private Sub Command4_Click()
Unload Me
End Sub
Private Sub Command5_Click()
On Error Resume Next
If (MsgBox("你真的想删除日期为 " & Combo2.Text & " 的记录吗?", vbOKCancel, "系统提示")) = vbOK Then
Adodc1.Refresh
Adodc1.Recordset.ActiveConnection.Execute "delete from weigui where 日期='" & Trim(Combo2.Text) & "'"
Combo2.Text = ""
MsgBox "删除成功", , "系统提示"
End If
Unload Me
End Sub
Private Sub Command6_Click()
Unload Me
End Sub
Private Sub Form_Load()
On Error Resume Next
provider = "provider=Microsoft.jet.oledb.4.0"
datasource = "data source=" & App.Path & "\DB.mdb"
With Adodc1
.Mode = adModeReadWrite
.ConnectionString = provider & ";" & datasource
.CommandType = adCmdTable
.RecordSource = "weigui"
.Refresh
End With
s = "select distinct 日期 from weigui"
With Adodc2
.Mode = adModeReadWrite
.ConnectionString = provider & ";" & datasource
.CommandType = adCmdText
.RecordSource = s
.Refresh
End With
For i = 1 To Adodc2.Recordset.RecordCount
Combo1.AddItem (Adodc2.Recordset.Fields("日期"))
Combo2.AddItem (Adodc2.Recordset.Fields("日期"))
Adodc2.Recordset.MoveNext
Next
Option1.Value = True
Frame3.Visible = True
Frame5.Visible = False
Frame6.Visible = False
End Sub
Private Sub Option1_Click()
Frame3.Visible = True
Frame5.Visible = False
Frame6.Visible = False
End Sub
Private Sub Option2_Click()
Frame3.Visible = False
Frame5.Visible = True
Frame6.Visible = False
End Sub
Private Sub Option3_Click()
Frame3.Visible = False
Frame5.Visible = False
Frame6.Visible = True
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -