📄 form1.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Form1
Caption = "登陆窗口"
ClientHeight = 6075
ClientLeft = 2430
ClientTop = 2400
ClientWidth = 7200
LinkTopic = "Form1"
Picture = "Form1.frx":0000
ScaleHeight = 6075
ScaleWidth = 7200
Begin VB.ComboBox Combousername
Height = 300
Left = 3000
TabIndex = 6
Top = 2400
Width = 1815
End
Begin MSAdodcLib.Adodc Adodc1
Height = 495
Left = 8040
Top = 5400
Width = 1215
_ExtentX = 2143
_ExtentY = 873
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
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 cmdcancel
Caption = "取 消"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3960
TabIndex = 3
Top = 4440
Width = 1695
End
Begin VB.CommandButton cmdok
Cancel = -1 'True
Caption = "确 定"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1320
TabIndex = 2
Top = 4440
Width = 1695
End
Begin VB.TextBox txtpassword
Height = 375
IMEMode = 3 'DISABLE
Left = 3000
PasswordChar = "*"
TabIndex = 1
Top = 3360
Width = 1815
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "用户密码:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 375
Left = 1800
TabIndex = 5
Top = 3360
Width = 1215
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "用户名:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 375
Left = 1800
TabIndex = 4
Top = 2400
Width = 975
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "公寓管理信息系统"
BeginProperty Font
Name = "隶书"
Size = 36
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H0080FF80&
Height = 615
Left = 720
TabIndex = 0
Top = 1200
Width = 5895
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdOK_Click()
Dim objConn As New ADODB.Connection
Dim objRs As New ADODB.Recordset
Dim strConn As String
Dim dbDriver As String
sys_DBPath = "" & App.Path & "\数据.mdb"
dbDriver = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='" & sys_DBPath & "';Persist Security Info=False"
strConn = dbDriver
objConn.CommandTimeout = 60
objConn.CursorLocation = adUseClient
objConn.Open strConn
Combousername.SetFocus
objRs.Open "select * from 用户信息 where 用户名='" & Trim(Combousername.Text) & "'", objConn, 1, 1
If Not objRs.EOF Then
If objRs("密码") = Trim(txtpassword.Text) Then
Me.Visible = False
If objRs("权限") = "办公室" Then
MDIForm1.user.Enabled = True
MDIForm1.office.Enabled = True
MDIForm1.floor.Enabled = True
MDIForm1.repair.Enabled = True
MDIForm1.roomer.Enabled = True
MDIForm1.about.Enabled = True
MDIForm1.Show
MDIForm1.StatusBar1.Panels(1) = "您好!" & Trim(Combousername.Text) & " 您的权限为:办公室"
ElseIf objRs("权限") = "维修处" Then
MDIForm1.office.Enabled = False
MDIForm1.floor.Enabled = False
MDIForm1.roomer.Enabled = False
MDIForm1.Show
MDIForm1.StatusBar1.Panels(1) = "您好!" & Trim(Combousername.Text) & " 您的权限为:维修处"
ElseIf objRs("权限") = "楼道管理处" Then
MDIForm1.office.Enabled = False
MDIForm1.repair.Enabled = False
MDIForm1.roomer.Enabled = False
MDIForm1.Show
MDIForm1.StatusBar1.Panels(1) = "您好!" & Trim(Combousername.Text) & " 您的权限为:楼道管理处"
ElseIf objRs("权限") = "宿管委" Then
MDIForm1.office.Enabled = False
MDIForm1.floor.Enabled = False
MDIForm1.repair.Enabled = False
MDIForm1.Show
MDIForm1.StatusBar1.Panels(1) = "您好!" & Trim(Combousername.Text) & " 您的权限为:宿管委"
End If
Else
MsgBox "密码不正确!"
txtpassword.Text = ""
txtpassword.SetFocus
End If
End If
End Sub
Private Sub cmdcancel_Click()
End
End Sub
Private Sub Form_Load()
OK = False
miCount = 0
Set objConn = New ADODB.Connection
objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\数据.mdb;Persist Security Info=False"
objConn.CursorLocation = adUseClient
objConn.Open
Dim yhxx As New ADODB.Recordset
Dim query0 As String
query0 = "select * from 用户信息"
yhxx.Open query0, objConn, 3, 3
If yhxx.RecordCount > 0 Then
For a = 1 To yhxx.RecordCount
Combousername.AddItem yhxx.Fields(0)
yhxx.MoveNext
Next
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -