📄 frmcreatuser.frm
字号:
VERSION 5.00
Begin VB.Form FrmCreatUser
BackColor = &H00C0E0FF&
BorderStyle = 0 'None
Caption = "Creat User"
ClientHeight = 4110
ClientLeft = 0
ClientTop = 0
ClientWidth = 5820
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 4110
ScaleWidth = 5820
ShowInTaskbar = 0 'False
Begin VB.CommandButton Command2
BackColor = &H00808080&
Caption = "Quit"
BeginProperty Font
Name = "MS Sans Serif"
Size = 13.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2280
Style = 1 'Graphical
TabIndex = 7
Top = 3120
Width = 3255
End
Begin VB.CommandButton Command1
BackColor = &H00808080&
Caption = "Create User"
BeginProperty Font
Name = "MS Sans Serif"
Size = 13.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2280
Style = 1 'Graphical
TabIndex = 6
Top = 2400
Width = 3255
End
Begin VB.ListBox List1
Appearance = 0 'Flat
Height = 2955
Left = 240
Sorted = -1 'True
TabIndex = 4
Top = 720
Width = 1695
End
Begin VB.TextBox Text2
Appearance = 0 'Flat
Height = 375
Left = 3600
TabIndex = 1
Top = 1440
Width = 1935
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
Height = 405
Left = 3600
TabIndex = 0
Top = 720
Width = 1935
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "User Name"
BeginProperty Font
Name = "Times New Roman"
Size = 14.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000040&
Height = 495
Index = 1
Left = 240
TabIndex = 5
Top = 360
Width = 975
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "Password"
BeginProperty Font
Name = "Times New Roman"
Size = 14.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000040&
Height = 495
Left = 2160
TabIndex = 3
Top = 1440
Width = 1575
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "User Name"
BeginProperty Font
Name = "Times New Roman"
Size = 14.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000040&
Height = 375
Index = 0
Left = 2160
TabIndex = 2
Top = 720
Width = 975
End
End
Attribute VB_Name = "FrmCreatUser"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim MyDb As Database, MyRs As Recordset
Private Sub Command1_Click()
Set MyDb = DBEngine.Workspaces(0).OpenDatabase("D:\HOTEL\USER\USER.MDB")
Set MyRs = MyDb.OpenRecordset("USERDB", dbOpenDynaset)
If Text1.Text = "" And Text2.Text = "" Then
MsgBox "Plaes enter the user name and password"
Exit Sub
End If
MyRs.AddNew
MyRs!UserName = Text1.Text
MyRs!PASS = Text2.Text
MyRs.Update
MyDb.Close
Form_Load
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Me.Left = MDIForm1.Left + 1000
Me.Top = MDIForm1.Top + 1000
List1.Clear
Set MyDb = DBEngine.Workspaces(0).OpenDatabase("D:\HOTEL\USER\USER.MDB")
Set MyRs = MyDb.OpenRecordset("USERDB", dbOpenDynaset)
If MyRs.RecordCount = 0 Then
Exit Sub
Else
Do While Not MyRs.EOF
List1.AddItem MyRs!UserName
MyRs.MoveNext
Loop
MyDb.Close
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -