【VB开源代码栏目提醒】:网学会员为需要VB开源代码的朋友们搜集整理了admin_insert.frm相关资料,希望对各位网友有所帮助!
VERSION 5.00
Begin VB.Form admin_insert
Caption = "添加用户"
ClientHeight = 4470
ClientLeft = 60
ClientTop = 345
ClientWidth = 4995
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form1"
ScaleHeight = 4470
ScaleWidth = 4995
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command2
Caption = "关闭"
Height = 495
Left = 2760
TabIndex = 9
Top = 3480
Width = 975
End
Begin VB.CommandButton Command1
Caption = "添加"
Height = 495
Left = 1080
TabIndex = 8
Top = 3480
Width = 975
End
Begin VB.ComboBox Combo1
Height = 330
ItemData = "admin_insert.frx":0000
Left = 1920
List = "admin_insert.frx":000A
Style = 2 'Dropdown List
TabIndex = 4
Top = 2640
Width = 1935
End
Begin VB.TextBox Text3
Height = 375
IMEMode = 3 'DISABLE
Left = 1920
PasswordChar = "*"
TabIndex = 3
Top = 1920
Width = 1935
End
Begin VB.TextBox Text2
Height = 375
IMEMode = 3 'DISABLE
Left = 1920
PasswordChar = "*"
TabIndex = 2
Top = 1320
Width = 1935
End
Begin VB.TextBox Text1
Height = 375
Left = 1920
TabIndex = 0
Top = 600
Width = 1935
End
Begin VB.Label Label4
Caption = "权 限:"
Height = 375
Left = 720
TabIndex = 7
Top = 2640
Width = 1215
End
Begin VB.Label Label3
Caption = "确认密码:"
Height = 375
Left = 720
TabIndex = 6
Top = 1920
Width = 1095
End
Begin VB.Label Label2
Caption = "密 码:"
Height = 375
Left = 720
TabIndex = 5
Top = 1320
Width = 1215
End
Begin VB.Label Label1
Caption = "帐 号:"
Height = 375
Left = 720
TabIndex = 1
Top = 600
Width = 1095
End
End
Attribute VB_Name = "admin_insert"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & App.Path & "\file.mdb;Persist Security Info=False"
If (Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Or Combo1.Text = "") Then
MsgBox "请填写完整每一项"
Else
sql = "select * from info_admin where account='" & Text1.Text & "'"
rs.Open sql, cn, 1, 1
If rs.EOF <> True Then
MsgBox "该帐号已存在"
Else
If Trim(Text2.Text) <> Trim(Text3.Text) Then
MsgBox "两次密码输入不一致"
Else
rs.Close
sql = "select * from info_admin"
rs.Open sql, cn, 3, 2
rs.AddNew
rs("account") = Trim(Text1.Text)
rs("password") = Trim(Text2.Text)
If Combo1.Text = "操作员" Then
rs("limit") = 0
Else
rs("limit") = 1
End If
rs.Update
MsgBox "添加成功"
End If
End If
End If
End Sub
上一篇:
admin_delete.frm
下一篇:
4种小菜缓解孕妈咪不适