📄 gdhregister.frm
字号:
VERSION 5.00
Begin VB.Form gdhRegister
Caption = "注册"
ClientHeight = 4095
ClientLeft = 60
ClientTop = 450
ClientWidth = 6240
LinkTopic = "Form1"
ScaleHeight = 4095
ScaleWidth = 6240
StartUpPosition = 3 'Windows Default
Begin VB.TextBox Text1
Height = 375
Index = 6
Left = 1560
TabIndex = 15
Top = 3120
Width = 3615
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 3600
TabIndex = 13
Top = 3600
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "确认"
Height = 375
Left = 1560
TabIndex = 12
Top = 3600
Width = 975
End
Begin VB.TextBox Text1
Height = 375
Index = 5
Left = 1560
TabIndex = 11
Top = 2640
Width = 3615
End
Begin VB.TextBox Text1
Height = 375
Index = 4
Left = 1560
TabIndex = 10
Top = 2160
Width = 3615
End
Begin VB.TextBox Text1
Height = 375
Index = 3
Left = 1560
TabIndex = 9
Top = 1680
Width = 3615
End
Begin VB.TextBox Text1
Height = 375
IMEMode = 3 'DISABLE
Index = 2
Left = 1560
PasswordChar = "*"
TabIndex = 8
Top = 1200
Width = 2175
End
Begin VB.TextBox Text1
Height = 375
IMEMode = 3 'DISABLE
Index = 1
Left = 1560
PasswordChar = "*"
TabIndex = 7
Top = 720
Width = 2175
End
Begin VB.TextBox Text1
Height = 375
Index = 0
Left = 1560
TabIndex = 6
Top = 240
Width = 2175
End
Begin VB.Label Label1
Caption = "联系电话"
Height = 375
Index = 6
Left = 240
TabIndex = 14
Top = 3120
Width = 1095
End
Begin VB.Label Label1
Caption = "邮政编码"
Height = 375
Index = 5
Left = 240
TabIndex = 5
Top = 2640
Width = 1095
End
Begin VB.Label Label1
Caption = "地址"
Height = 375
Index = 4
Left = 240
TabIndex = 4
Top = 2160
Width = 1095
End
Begin VB.Label Label1
Caption = "单位名称"
Height = 375
Index = 3
Left = 240
TabIndex = 3
Top = 1680
Width = 1095
End
Begin VB.Label Label1
Caption = "确认密码"
Height = 375
Index = 2
Left = 240
TabIndex = 2
Top = 1200
Width = 1095
End
Begin VB.Label Label1
Caption = "密码"
Height = 375
Index = 1
Left = 240
TabIndex = 1
Top = 720
Width = 1095
End
Begin VB.Label Label1
Caption = "用户名"
Height = 375
Index = 0
Left = 240
TabIndex = 0
Top = 240
Width = 1095
End
End
Attribute VB_Name = "gdhRegister"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim db As New Adodb.Connection
Dim rs As New Adodb.Recordset
Dim Query As String
Dim strNOw As String
On Error GoTo ok
If MsgBox("请确认信息完全正确!确实要注册吗?", vbYesNo + vbDefaultButton2) <> vbYes Then
Exit Sub
End If
If Checking = False Then
Exit Sub
End If
db.CursorLocation = adUseClient
db.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\admin.mdb;Jet OLEDB:Database Password=dfrwadmin;"
If db.State <> 1 Then
Exit Sub
End If
strNOw = Format(Now, "yyyy-mm-dd hh:mm:ss")
Query = "insert into users(用户名,密码,类型,创建时间,单位名称,地址,邮政编码,联系电话)"
Query = Query & "values('" & Text1(0).text & "','" & Text1(1).text & "'," & True & ",'" & strNOw & "','" & Text1(3).text & "'"
Query = Query & ",'" & Text1(4).text & "','" & Text1(5).text & "','" & Text1(6).text & "')"
db.Execute Query
db.Close
MsgBox "注册成功,请退出再登录系统!"
Exit Sub
ok:
MsgBox "注册失败!请重新运行注册程序"
End Sub
Function Checking() As Boolean
If Trim(Text1(0).text) = "" Then
MsgBox "请填写用户名"
Text1(0).SetFocus
Exit Function
End If
If Trim(Text1(1).text) = "" Then
MsgBox "请填写密码"
Text1(1).SetFocus
Exit Function
End If
If Trim(Text1(2).text) = "" Then
MsgBox "请填写确认密码"
Text1(2).SetFocus
Exit Function
End If
If Trim(Text1(1).text) <> Trim(Text1(2).text) Then
MsgBox "两次输入的密码不一致,请更正密码"
Text1(0).SetFocus
Exit Function
End If
Checking = True
End Function
Private Sub Command2_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -