📄 application.frm
字号:
VERSION 5.00
Object = "{E95A2510-F3D1-416D-823B-4F840FE98091}#3.0#0"; "COMMAND.OCX"
Begin VB.Form Application
Caption = "友情强档——申请界面"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
Icon = "Application.frx":0000
KeyPreview = -1 'True
LinkTopic = "Form1"
MaxButton = 0 'False
Moveable = 0 'False
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 2 '屏幕中心
Begin CSCommand.Command cmdCancel
Height = 375
Left = 3000
TabIndex = 6
Top = 2280
Width = 975
_ExtentX = 1720
_ExtentY = 661
Icon = "Application.frx":08CA
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
Appearance = 2
BackStyle = 0
End
Begin CSCommand.Command cmdOK
Height = 375
Left = 600
TabIndex = 5
Top = 2280
Width = 975
_ExtentX = 1720
_ExtentY = 661
Icon = "Application.frx":0BE4
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
Appearance = 2
BackStyle = 0
End
Begin VB.TextBox txtPassWord
Height = 270
IMEMode = 3 'DISABLE
Left = 2160
PasswordChar = "*"
TabIndex = 4
Top = 1800
Width = 1215
End
Begin VB.TextBox txtUserName
Height = 270
Left = 2160
TabIndex = 3
Top = 1080
Width = 1215
End
Begin VB.Label Label4
Alignment = 2 'Center
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "密码确认:"
ForeColor = &H00FFFFFF&
Height = 180
Left = 1080
TabIndex = 2
Top = 1800
Width = 900
End
Begin VB.Label Label1
Alignment = 2 'Center
AutoSize = -1 'True
BackColor = &H00FFFFFF&
BackStyle = 0 'Transparent
Caption = "用户申请"
BeginProperty Font
Name = "华文行楷"
Size = 21.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 450
Left = 1320
TabIndex = 1
Top = 240
Width = 1755
End
Begin VB.Label Label2
Alignment = 2 'Center
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "用户名:"
ForeColor = &H00FFFFFF&
Height = 180
Left = 1080
TabIndex = 0
Top = 1080
Width = 720
End
Begin VB.Image Image1
Enabled = 0 'False
Height = 9000
Left = 0
Picture = "Application.frx":0EFE
Top = -480
Width = 12000
End
End
Attribute VB_Name = "application"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim Cost As ADODB.Recordset '用户名记录
Dim Coste As ADODB.Recordset '密码记录
Dim cnStr As String '用户名查询
Dim cnAcc As String '密码查询
Dim Add As Boolean
Private Sub cmdCancel_Click()
Unload Me
Land.Show
End Sub
Private Sub cmdOk_Click()
Add = False
' Cost.MoveFirst
' Coste.MoveFirst
Cost.Find "userid='" & txtUserName.Text & "'"
Coste.Find "Code=' " & txtPassWord.Text & "'"
If Trim(txtUserName.Text) = "" Then
MsgBox "用户名不能为空,请输入您要申请的用户名", vbOKOnly + vbExclamation, "用户申请"
txtUserName.Text = ""
txtPassWord.Text = ""
txtUserName.SetFocus
Exit Sub
End If
' If Cost(0) = Trim(txtUserName.Text) Then
If Cost.EOF = False Then
MsgBox "此用户名已存在,请另外输入!", vbOKOnly + vbExclamation, "用户申请"
txtUserName.Text = ""
txtPassWord.Text = ""
txtUserName.SetFocus
Else
Add = True
End If
If Add = False Then
MsgBox "用户申请未成功!", vbOKOnly + vbExclamation, "用户申请"
txtUserName.Text = ""
txtPassWord.Text = ""
txtUserName.SetFocus
Else
Cost.AddNew
Cost(0) = Trim(txtUserName.Text)
Cost(1) = Trim(txtPassWord.Text)
Cost.Update
Cost.Close
MsgBox "用户申请成功!", vbOKOnly + vbExclamation, "用户申请"
txtUserName.Text = ""
txtPassWord.Text = ""
Unload Me
Land.Show
End If
End Sub
Private Sub Form_Load()
Set Cost = New ADODB.Recordset
cnStr = "select * from Consumer"
Cost.Open cnStr, cnFriend, adOpenKeyset, adLockOptimistic, adCmdText
Set Coste = New ADODB.Recordset
cnAcc = "select * from Consumer"
Coste.Open cnAcc, cnFriend, adOpenKeyset, adLockOptimistic, adCmdText
Add = False
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -