📄 form1.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form 登陆
BackColor = &H00FF8080&
BorderStyle = 3 'Fixed Dialog
Caption = "Form1"
ClientHeight = 2610
ClientLeft = 45
ClientTop = 435
ClientWidth = 4815
Icon = "Form1.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2610
ScaleWidth = 4815
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command2
BackColor = &H00C0FFC0&
Caption = "取消"
Height = 375
Left = 2280
Style = 1 'Graphical
TabIndex = 5
Top = 1680
UseMaskColor = -1 'True
Width = 1215
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 4320
Top = 3840
Visible = 0 'False
Width = 1575
_ExtentX = 2778
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\study and work\works\duoduo电脑医生\工程\data.mdb;Persist Security Info=False"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\study and work\works\duoduo电脑医生\工程\data.mdb;Persist Security Info=False"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "系统"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.CommandButton Command1
BackColor = &H00C0FFC0&
Caption = "登陆"
Height = 375
Left = 480
Style = 1 'Graphical
TabIndex = 4
Top = 1680
UseMaskColor = -1 'True
Width = 1215
End
Begin VB.TextBox Text2
Height = 375
IMEMode = 3 'DISABLE
Left = 1320
PasswordChar = "*"
TabIndex = 3
Text = "Text2"
Top = 960
Width = 2055
End
Begin VB.TextBox Text1
Height = 375
Left = 1320
TabIndex = 2
Text = "Text1"
Top = 120
Width = 2055
End
Begin VB.Label Label2
BackColor = &H00FF8080&
Caption = "密码"
BeginProperty Font
Name = "幼圆"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 480
TabIndex = 1
Top = 960
Width = 1095
End
Begin VB.Label Label1
BackColor = &H00FF8080&
Caption = "账号"
BeginProperty Font
Name = "幼圆"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 480
TabIndex = 0
Top = 120
Width = 1095
End
End
Attribute VB_Name = "登陆"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim samp1, samp2 As Boolean
Adodc1.Recordset.MoveFirst
'验证是否输入合法
If Text1 = "" Then
MsgBox "对不起,请输入帐号!", vbInformation, "消息提示"
Exit Sub
End If
If Text2 = "" Then
MsgBox "对不起,请输入密码!", vbInformation, "消息提示"
Exit Sub
End If
'数据库信息核对
Adodc1.RecordSource = "select * from 系统"
For i = 1 To Adodc1.Recordset.RecordCount
If Adodc1.Recordset.Fields("user") = Text1.Text Then
samp1 = True
If Adodc1.Recordset.Fields("psw") = Text2.Text Then
samp2 = True
End If
Else:
Adodc1.Recordset.MoveNext
End If
Next i
If samp1 = False Then
MsgBox "没有这个帐号!请重新输入", vbExclamation, "消息提示"
Else
If samp2 = False Then
MsgBox "密码错误,请重新输入", vbCritical, "消息提示"
Exit Sub
End If
End If
If samp2 = True Then
选择.Show
Unload Me
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Adodc1.RecordSource = "系统"
Adodc1.Refresh
Text1 = ""
Text2 = ""
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -