📄 kjxt.frm
字号:
End
Begin VB.CommandButton cmdrefresh
Caption = "刷新"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 5640
TabIndex = 7
Top = 2760
Width = 1095
End
Begin VB.CommandButton cmdsave
Caption = "保存"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 5640
TabIndex = 6
Top = 1920
Width = 1095
End
Begin VB.CommandButton cmddelete
Caption = "删除"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 5640
TabIndex = 5
Top = 1200
Width = 1095
End
Begin VB.CommandButton cmdadd
Caption = "添加"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 5640
TabIndex = 4
Top = 480
Width = 1095
End
Begin VB.TextBox txtpwd
DataField = "口令"
DataSource = "Adodc1"
Height = 735
IMEMode = 3 'DISABLE
Left = 1800
PasswordChar = "*"
TabIndex = 3
Top = 1560
Width = 2175
End
Begin VB.TextBox txtuser
DataField = "用户名"
DataSource = "Adodc1"
Height = 735
Left = 1800
TabIndex = 2
Top = 480
Width = 2175
End
Begin VB.Label Label3
Caption = "身份"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 240
TabIndex = 12
Top = 2520
Width = 1455
End
Begin VB.Label Label2
Caption = "口令"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 240
TabIndex = 1
Top = 1560
Width = 1335
End
Begin VB.Label Label1
Caption = "用户名"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 240
TabIndex = 0
Top = 480
Width = 1335
End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmbstatus_WillMove(ByVal adReason As ADODB.EventReasonEnum, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
End Sub
Dim objcopy As New ADODB.Recordset
Private Sub adodc1_WillMove(ByVal adReason As ADODB.EventReasonEnum, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
'adodc1.Caption = "当前纪录" + adodc1.Recordset.AbsolutePosition + "/" + adodc1.Recordset.RecordCount
End Sub
Private Sub cmdadd_Click()
Adodc1.Recordset.AddNew
cmdadd.Enabled = False
cmddelete.Enabled = False
Adodc1.Enabled = False
cmbstatus.ListIndex = 1
txtuser.SetFocus
End Sub
Private Sub cmddelete_Click()
If MsgBox("真的要删除" + txtuser + "吗?", vbQuestion + vbYesNo, "提示窗") = vbYes Then
Adodc1.Recordset.Delete
Adodc1.Recordset.MoveNext
End If
If Adodc1.EOFAction Then
Adodc1.Recordset.MoveLast
End If
End Sub
Private Sub cmdend_Click()
Adodc1.Recordset.MoveLast
End Sub
Private Sub cmdexit_Click()
Form1.Show
Form2.Hide
End Sub
Private Sub cmdfirst_Click()
Adodc1.Recordset.MoveFirst
End Sub
Private Sub cmdin_Click()
Form3.Show
Form2.Hide
End Sub
Private Sub cmdnext_Click()
Adodc1.Recordset.MoveNext
If Adodc1.Recordset.EOF = True Then
MsgBox "已经是末纪录!", vbCritical, " 提示窗!"
Adodc1.Recordset.MoveLast
End If
End Sub
Private Sub cmdrefresh_Click()
Adodc1.Refresh
cmdadd.Enabled = True
cmddelete.Enabled = True
Adodc1.Enabled = True
End Sub
Private Sub cmdrow_Click()
Adodc1.Recordset.Sort = "身份 asc,口令 desc"
End Sub
Private Sub cmdsave_Click()
If Trim(txtuser) = "" Then
MsgBox "用户名不能为空", vbCritical, "提示窗"
txtuser.Text = ""
txtuser.SetFocus
ElseIf Trim(txtpwd) = "" Then
MsgBox "口令不能为空", vbCritical, "提示窗"
txtpwd.Text = ""
txtpwd.SetFocus
ElseIf (cmbstatus) = "" Then
MsgBox "身份不能为空", vbCritical, "提示窗"
cmbstatus.Text = ""
cmbstatus.SetFocus
'ElseIf objcopy.RecordCount > 0 Then
'objcopy.Find "用户名'" + txtuser + "'"
'If Not objcopy.EOF And objcopy.AbsolutePosition <> adodc1.Recordset.AbsolutePosition Then
'MsgBox "用户名:" + txtuser + "已存在!", vbCritical, "提示窗!"
'txtuser.SetFocus
'Exit Sub
'End If
'Set objcopy = adodc1.Recordset.Clone
Else
Adodc1.Recordset.Update
cmdadd.Enabled = True
cmddelete.Enabled = True
Adodc1.Enabled = True
MsgBox "已经成功加入!", vbInformation, "提示窗"
End If
End Sub
Private Sub cmdselect_Click()
a = Adodc1.Recordset.AbsolutePosition
Adodc1.Recordset.Find "用户名='" + Text1 + "'"
If Not Adodc1.Recordset.EOF Then
Label1.Caption = Adodc1.Recordset("用户名")
Else
MsgBox "未发现纪录", vbCritical, "提示窗"
Adodc1.Recordset.Move a - 1, 1
End If
End Sub
Private Sub cmdselect1_Click()
a = Adodc1.Recordset.AbsolutePosition
Adodc1.Recordset.Find "用户名='" + txtselectuser + "'"
If Not Adodc1.Recordset.EOF Then
Label1.Caption = Adodc1.Recordset("用户名")
Else
MsgBox "未发现纪录", vbCritical, "提示窗"
Adodc1.Recordset.Move a - 1, 1
End If
End Sub
Private Sub cmdselect2_Click()
a = Adodc1.Recordset.AbsolutePosition
Adodc1.Recordset.Find "口令='" + txtselectpwd + "'"
If Not Adodc1.Recordset.EOF Then
Label2.Caption = Adodc1.Recordset("口令")
Else
MsgBox "未发现纪录", vbCritical, "提示窗"
Adodc1.Recordset.Move a - 1, 1
End If
End Sub
Private Sub cmdselect3_Click()
a = Adodc1.Recordset.AbsolutePosition
Adodc1.Recordset.Find "身份='" + txtselectid + "'"
If Not Adodc1.Recordset.EOF Then
Label1.Caption = Adodc1.Recordset("身份")
Else
MsgBox "未发现纪录", vbCritical, "提示窗"
Adodc1.Recordset.Move a - 1, 1
End If
End Sub
Private Sub cmdsti_Click()
a = Adodc1.Recordset.AbsolutePosition
b = cmbstatus
s = 0
Adodc1.Recordset.MoveFirst
Do While Not Adodc1.Recordset.EOF
If Adodc1.Recordset.Fields("身份") = b Then
s = s + Val(Adodc1.Recordset.Fields("口令"))
End If
Adodc1.Recordset.MoveNext
Loop
End Sub
Private Sub cmdup_Click()
Adodc1.Recordset.MovePrevious
If Adodc1.Recordset.BOF = True Then
MsgBox "已经是第一条纪录!", vbCritical, "提示窗!"
Adodc1.Recordset.MoveFirst
End If
End Sub
Private Sub Form_Load()
Set objcoipy = Adodc1.Recordset.Clone
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -