?? frmadduser.frm
字號:
VERSION 5.00
Object = "{D959C709-8613-11D1-9840-002078110E7D}#1.0#0"; "as97Popup.ocx"
Object = "{C7AE747C-B9E4-11D7-B0E3-D8165009166E}#7.0#0"; "XPForm.ocx"
Begin VB.Form frmadduser
BorderStyle = 0 'None
Caption = "添加擁戶"
ClientHeight = 4080
ClientLeft = 0
ClientTop = 0
ClientWidth = 5430
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 4080
ScaleWidth = 5430
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin XP窗體控件.XPForm XPForm1
Height = 810
Left = 4080
Top = 1680
Width = 1920
_ExtentX = 3387
_ExtentY = 1429
Caption = "添加擁戶"
AlwaysOnTop = 0 'False
ShowFormSize = 0 'False
End
Begin as97Popup.asPopup asPopup2
Height = 375
Left = 2160
Top = 3240
Width = 975
_ExtentX = 1720
_ExtentY = 661
Caption = "取消"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ScaleWidth = 65
ScaleMode = 0
ScaleHeight = 25
End
Begin as97Popup.asPopup asPopup1
Height = 375
Left = 720
Top = 3240
Width = 1095
_ExtentX = 1931
_ExtentY = 661
Caption = "確定"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ScaleWidth = 73
ScaleMode = 0
ScaleHeight = 25
End
Begin VB.ComboBox Combo1
Height = 300
Left = 1800
TabIndex = 7
Top = 2280
Width = 1935
End
Begin VB.TextBox Text3
Height = 405
IMEMode = 3 'DISABLE
Left = 1800
PasswordChar = "*"
TabIndex = 6
Top = 1680
Width = 1935
End
Begin VB.TextBox Text2
Height = 405
IMEMode = 3 'DISABLE
Left = 1800
PasswordChar = "*"
TabIndex = 5
Top = 1080
Width = 1935
End
Begin VB.TextBox Text1
Height = 405
Left = 1800
TabIndex = 4
Top = 480
Width = 1935
End
Begin VB.Label Label4
AutoSize = -1 'True
BackColor = &H80000018&
Caption = "選擇權限"
Height = 195
Left = 840
TabIndex = 3
Top = 2280
Width = 720
End
Begin VB.Label Label3
AutoSize = -1 'True
BackColor = &H80000018&
Caption = "確認密碼"
Height = 195
Left = 840
TabIndex = 2
Top = 1800
Width = 720
End
Begin VB.Label Label2
AutoSize = -1 'True
BackColor = &H80000018&
Caption = "輸入密碼"
Height = 195
Left = 840
TabIndex = 1
Top = 1080
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
BackColor = &H80000018&
Caption = "輸入用戶名"
Height = 195
Left = 840
TabIndex = 0
Top = 600
Width = 900
End
End
Attribute VB_Name = "frmadduser"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub asPopup1_Click(Cancel As Boolean)
On Error Resume Next
Dim sql As String
Dim rs_add As New ADODB.Recordset
Dim connecting As String
Dim conn1 As New ADODB.Connection
connecting = "provider=Microsoft.Jet.oledb.4.0;" & _
"data source=" & App.Path & "\jk.mdb"
Horizontal Me, RGB(131, 166, 244), RGB(33, 120, 224)
conn1.Open connecting
If Trim(Text1.Text) = "" Then
MsgBox "用戶名不能為空", vbOKOnly + vbExclamation, ""
Exit Sub
Text1.SetFocus
Else
sql = "select * from 密碼表"
rs_add.Open sql, conn1, adOpenKeyset, adLockPessimistic
While (rs_add.EOF = False)
If Trim(rs_add.Fields(0)) = Trim(Text1.Text) Then
MsgBox "已有這個用戶", vbOKOnly + vbExclamation, ""
Text1.SetFocus
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Combo1.Text = ""
Exit Sub
Else
rs_add.MoveNext
End If
Wend
If Trim(Text2.Text) <> Trim(Text3.Text) Then
MsgBox "兩次密碼不一致", vbOKOnly + vbExclamation, ""
Text2.SetFocus
Text2.Text = ""
Text3.Text = ""
Exit Sub
ElseIf Trim(Combo1.Text) <> "操作員" And Trim(Combo1.Text) <> "使用者" And Trim(Combo1.Text) <> "管理員" Then
MsgBox "請選擇正確的用戶權限", vbOKOnly + vbExclamation, ""
Combo1.SetFocus
Combo1.Text = ""
Exit Sub
Else
rs_add.AddNew
rs_add.Fields(0) = Text1.Text
rs_add.Fields(1) = Text2.Text
rs_add.Fields(2) = Combo1.Text
rs_add.Update
rs_add.Close
TimeDelay 100
MsgBox "添加用戶成功", vbOKOnly + vbExclamation, ""
TimeDelay 100
Set conn1 = Nothing
Unload Me
End If
End If
End Sub
Private Sub asPopup2_Click(Cancel As Boolean)
Unload Me
End Sub
Private Sub Form_Load()
XPForm1.Make
Combo1.AddItem "使用者"
Combo1.AddItem "操作員"
Combo1.AddItem "管理員"
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -