?? frmuseradd.frm
字號:
VERSION 5.00
Begin VB.Form frmUserAdd
Caption = "添加用戶"
ClientHeight = 4980
ClientLeft = 60
ClientTop = 450
ClientWidth = 5655
LinkTopic = "Form3"
ScaleHeight = 4980
ScaleWidth = 5655
StartUpPosition = 3 '窗口缺省
Begin VB.ComboBox cobPower
Height = 300
ItemData = "frmUserAdd.frx":0000
Left = 2280
List = "frmUserAdd.frx":000D
TabIndex = 9
Text = "借閱操作員"
Top = 3000
Width = 2055
End
Begin VB.TextBox txtPassword
Height = 375
IMEMode = 3 'DISABLE
Left = 2280
PasswordChar = "*"
TabIndex = 8
Top = 1320
Width = 2055
End
Begin VB.TextBox txtPasswordConfirm
Height = 375
IMEMode = 3 'DISABLE
Left = 2280
PasswordChar = "*"
TabIndex = 7
Top = 2160
Width = 2055
End
Begin VB.TextBox txtUser
Height = 375
Left = 2280
TabIndex = 6
Top = 480
Width = 2055
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 495
Left = 3000
TabIndex = 5
Top = 3960
Width = 1455
End
Begin VB.CommandButton Command1
Caption = "確定"
Height = 495
Left = 960
TabIndex = 4
Top = 3960
Width = 1455
End
Begin VB.Label Label4
Caption = "登陸權(quán)限"
Height = 375
Left = 600
TabIndex = 3
Top = 3000
Width = 975
End
Begin VB.Label Label3
Caption = "確認(rèn)密碼"
Height = 375
Left = 600
TabIndex = 2
Top = 2160
Width = 975
End
Begin VB.Label Label2
Caption = "密碼"
Height = 375
Left = 600
TabIndex = 1
Top = 1320
Width = 975
End
Begin VB.Label Label1
Caption = "用戶名"
Height = 375
Left = 600
TabIndex = 0
Top = 480
Width = 975
End
End
Attribute VB_Name = "frmUserAdd"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Combo1_Change()
End Sub
Private Sub Command1_Click()
Dim conn As ADODB.Connection
Dim rs As New ADODB.Recordset
Dim sql As String
Dim N As Boolean
N = True
If Trim(txtUser.Text) = "" Then
MsgBox "用戶名不能為空", vbOKOnly + vbExclamation, ""
txtUser.SetFocus
N = False
End If
If Trim(txtPassword.Text) = "" Then
MsgBox "密碼不能為空", vbOKOnly + vbExclamation, ""
txtPassword.SetFocus
N = False
End If
If Trim(txtPasswordConfirm.Text) <> Trim(txtPassword.Text) Then
MsgBox "密碼不一致", vbOKOnly + vbExclamation, ""
txtPasswordConfirm.SetFocus
N = False
End If
If N = False Then
MsgBox "添加用戶信息失敗", vbOKOnly
Else
Set conn = New ADODB.Connection
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=book.mdb;Persist Security Info=False"
conn.Open
sql = "select*from UserInfo where UserName ='" + txtUser.Text + "'"
rs.Open sql, conn, adOpenKeyset, adLockPessimistic
If rs.EOF Then
rs.AddNew
rs.Fields(1) = Trim(txtUser.Text)
rs.Fields(2) = Trim(txtPassword.Text)
rs.Fields(3) = Trim(cobPower.Text)
rs.Update
MsgBox "添加用戶成功", vbOKOnly, ""
rs.Close
Else
MsgBox "用戶名重復(fù)!", vbOKOnly + vbExclamation, ""
txtUser.SetFocus
txtUser.Text = ""
rs.Close
End If
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -