📄 usappendform.frm
字号:
VERSION 5.00
Begin VB.Form userappendform
BorderStyle = 0 'None
ClientHeight = 5070
ClientLeft = 0
ClientTop = 0
ClientWidth = 5145
LinkTopic = "Form1"
Picture = "usappendform.frx":0000
ScaleHeight = 338
ScaleMode = 3 'Pixel
ScaleWidth = 343
ShowInTaskbar = 0 'False
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox data_b
Appearance = 0 'Flat
BackColor = &H00E0E0E0&
Height = 270
Left = 2400
MaxLength = 20
TabIndex = 8
Top = 2355
Width = 1215
End
Begin VB.TextBox data_a
Appearance = 0 'Flat
BackColor = &H00E0E0E0&
Height = 270
Left = 2400
MaxLength = 10
TabIndex = 7
Top = 1755
Width = 1215
End
Begin VB.Label appendfrmmove
BackColor = &H00C0C0C0&
BackStyle = 0 'Transparent
Height = 285
Left = 360
TabIndex = 10
Top = 0
Width = 4320
End
Begin VB.Label Label1
Alignment = 1 'Right Justify
BackStyle = 0 'Transparent
Caption = "密 码"
ForeColor = &H00000000&
Height = 255
Left = 600
TabIndex = 9
Top = 2400
Width = 1500
End
Begin VB.Label lb_a
Alignment = 1 'Right Justify
BackStyle = 0 'Transparent
Caption = "用户名"
ForeColor = &H00000000&
Height = 255
Left = 600
TabIndex = 6
Top = 1800
Width = 1500
End
Begin VB.Label append_a
BackStyle = 0 'Transparent
Height = 330
Left = 1440
TabIndex = 5
Top = 3600
Width = 885
End
Begin VB.Label exit_a
BackStyle = 0 'Transparent
Height = 330
Left = 2880
TabIndex = 4
Top = 3600
Width = 885
End
Begin VB.Label append_b
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "填 加"
ForeColor = &H00404040&
Height = 180
Left = 1620
TabIndex = 3
Top = 3675
Width = 540
End
Begin VB.Shape append_c
BorderColor = &H00C0C0C0&
FillColor = &H00C0C0C0&
Height = 330
Left = 1440
Top = 3600
Width = 885
End
Begin VB.Label exit_b
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "返 回"
ForeColor = &H00404040&
Height = 180
Left = 3090
TabIndex = 2
Top = 3675
Width = 495
End
Begin VB.Shape exit_c
BorderColor = &H00C0C0C0&
FillColor = &H00C0C0C0&
Height = 330
Left = 2880
Top = 3600
Width = 885
End
Begin VB.Label formcaption
BackStyle = 0 'Transparent
Caption = "填加数据"
ForeColor = &H00000000&
Height = 165
Left = 2130
TabIndex = 1
Top = 90
Width = 735
End
Begin VB.Label frmcaption2
BackStyle = 0 'Transparent
Caption = "填加数据"
ForeColor = &H00FFFFFF&
Height = 165
Left = 2130
TabIndex = 0
Top = 75
Width = 735
End
End
Attribute VB_Name = "userappendform"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim rsTemp As ADODB.Recordset
Sub ClearData()
data_a.Text = ""
data_b.Text = ""
End Sub
Sub AppendRecord()
On Error GoTo err_exit
If Trim(data_a.Text) = "" Or Trim(data_b.Text) = "" Then
vMessageBox GetLStr(1), 2, 0
data_a.SetFocus
Exit Sub
End If
rsTemp.Open "select 管理员,密码 from 管理员表 where 管理员='" & _
Trim(data_a.Text) & "'", mydata.condata, adOpenStatic, adLockReadOnly
If rsTemp.RecordCount > 0 Then
vMessageBox GetLStr(10) & Trim(rsTemp("管理员")), 1, 0
data_a.SetFocus
Else
mydata.condata.Execute "insert into 管理员表 " & _
"(管理员,密码) values ('" & _
Trim(data_a.Text) & "','" & _
Trim(data_b.Text) & "'" & _
")"
vMessageBox GetLStr(3), 1, 0
ClearData
data_a.SetFocus
End If
rsTemp.Close
Exit Sub
err_exit:
vMessageBox Err.Description, 2, 0
End Sub
Private Sub append_a_Click()
AppendRecord
End Sub
Private Sub appendfrmmove_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
ReleaseCapture
SendMessage Me.hwnd, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0
End Sub
Private Sub data_a_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then SendKeys "{TAB}"
End Sub
Private Sub data_b_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
AppendRecord
End If
End Sub
Private Sub exit_a_Click()
Unload Me
userreg.Show
ReGird 104
End Sub
Private Sub Form_Load()
CenterForm Me
Set rsTemp = New ADODB.Recordset
SetLForm 18
End Sub
Private Sub append_a_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
append_c.BorderColor = &H808080
End Sub
Private Sub append_a_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
append_c.BorderColor = &HC0C0C0
End Sub
Private Sub exit_a_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
exit_c.BorderColor = &H808080
End Sub
Private Sub exit_a_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
exit_c.BorderColor = &HC0C0C0
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set rsTemp = Nothing
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -