📄 frm_yhtj.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form Frm_yhtj
BorderStyle = 1 'Fixed Single
Caption = "用户添加"
ClientHeight = 3495
ClientLeft = 5160
ClientTop = 4275
ClientWidth = 4830
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3495
ScaleWidth = 4830
Begin VB.Frame Frame1
Height = 2655
Left = 120
TabIndex = 3
Top = 720
Width = 4575
Begin VB.TextBox Text1
Height = 375
Index = 0
Left = 1800
TabIndex = 0
Top = 240
Width = 1455
End
Begin VB.TextBox Text1
Height = 375
Index = 1
Left = 1800
TabIndex = 1
Top = 1080
Width = 1455
End
Begin VB.TextBox Text1
Height = 375
Index = 2
Left = 1800
TabIndex = 2
Top = 1800
Width = 1455
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "用户密码"
Height = 255
Left = 720
TabIndex = 6
Top = 1920
Width = 735
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "用户编号"
Height = 255
Left = 720
TabIndex = 5
Top = 360
Width = 735
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "用户名称"
Height = 255
Left = 720
TabIndex = 4
Top = 1080
Width = 735
End
End
Begin MSComctlLib.ImageList ImageList1
Left = 3600
Top = 120
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 19
ImageHeight = 19
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 5
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_yhtj.frx":0000
Key = "IMG1"
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_yhtj.frx":0404
Key = "IMG2"
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_yhtj.frx":0FDB
Key = "IMG3"
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_yhtj.frx":185D
Key = "IMG4"
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_yhtj.frx":24BC
Key = "IMG5"
EndProperty
EndProperty
End
Begin MSComctlLib.Toolbar Toolbar1
Align = 1 'Align Top
Height = 660
Left = 0
TabIndex = 7
Top = 0
Width = 4830
_ExtentX = 8520
_ExtentY = 1164
ButtonWidth = 1773
ButtonHeight = 1005
Appearance = 1
ImageList = "ImageList1"
HotImageList = "ImageList1"
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 3
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = " 添加 "
Key = "save"
ImageIndex = 3
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = " 删除 "
Key = "delete"
ImageIndex = 2
EndProperty
BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = " 退出 "
Key = "exit"
ImageIndex = 5
EndProperty
EndProperty
End
End
Attribute VB_Name = "Frm_yhtj"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Index
Case 1
Dim AdoRs As New ADODB.Recordset
'If AdoRs.RecordCount > 0 Then
'MsgBox "该信息已经存在!"
'End If
If Text1(0).Text = "" Or Text1(1).Text = "" Then
MsgBox "重要内容不能为空!"
Text1(0).SetFocus
Exit Sub
End If
AdoRs.Open "select * from 用户表", cnn, adOpenKeyset, adLockOptimistic
AdoRs.AddNew
For i = 0 To 2
AdoRs.Fields(i) = Text1(i).Text
Next i
AdoRs.Update
AdoRs.Close
'MsgBox "数据保存成功!"
For i = 0 To 2
Text1(i) = ""
Next i
Case 2
If Text1(0).Text = "" Then
MsgBox "没有要删除的信息!"
Exit Sub
End If
c = MsgBox("确认删除信息吗?")
If c = vbOK Then
On Error Resume Next
Set AdoRs = cnn.Execute("Delete 用户表 where 用户编号 = '" & Text1(0).Text & "'")
AdoRs.Update
AdoRs.Close
End If
For i = 0 To 2
Text1(i) = ""
Next i
Case 3
Unload Me
End Select
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -