?? 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 + -