?? form2.frm
字號:
VERSION 5.00
Object = "{CE671F01-259E-40DA-92FE-95803E2ECBB5}#1.0#0"; "SMARTXPBUTTON.OCX"
Begin VB.Form Form2
BackColor = &H00E0E0E0&
Caption = "登錄"
ClientHeight = 3195
ClientLeft = 4800
ClientTop = 4695
ClientWidth = 4680
Icon = "Form2.frx":0000
LinkTopic = "Form2"
MaxButton = 0 'False
MinButton = 0 'False
Moveable = 0 'False
ScaleHeight = 3195
ScaleWidth = 4680
Begin VB.TextBox Text1
Height = 375
IMEMode = 3 'DISABLE
Left = 1800
PasswordChar = "*"
TabIndex = 5
Top = 1680
Width = 1695
End
Begin SmartXPButton.XpButton command2
Height = 375
Left = 2760
TabIndex = 4
Top = 2400
Width = 975
_ExtentX = 1720
_ExtentY = 661
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Caption = "退出"
PictureSmoothBackColor= 13882323
End
Begin SmartXPButton.XpButton command1
Height = 375
Left = 840
TabIndex = 3
Top = 2400
Width = 975
_ExtentX = 1720
_ExtentY = 661
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Caption = "確定"
PictureSmoothBackColor= 13882323
End
Begin VB.ComboBox Combo1
Height = 300
Left = 1800
TabIndex = 2
Top = 1080
Width = 1695
End
Begin VB.Image Image3
Height = 540
Left = 480
Picture = "Form2.frx":030A
Top = 1680
Width = 480
End
Begin VB.Image Image1
Height = 435
Left = 480
Picture = "Form2.frx":0E3C
Top = 960
Width = 510
End
Begin VB.Image Image2
Height = 870
Left = 0
Picture = "Form2.frx":18C4
Top = 0
Width = 4740
End
Begin VB.Label Label2
BackColor = &H00E0E0E0&
Caption = "密碼"
Height = 255
Left = 1200
TabIndex = 1
Top = 1800
Width = 495
End
Begin VB.Label Label1
BackColor = &H00E0E0E0&
Caption = "用戶名"
Height = 375
Left = 1200
TabIndex = 0
Top = 1080
Width = 615
End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim cnt As Integer '記錄確定次數
Public CurrentUser As String
Private Sub command1_Click()
Dim sql As String
Dim rs_login As New ADODB.Recordset
If Trim(Combo1.Text) = "" Then '判斷輸入的用戶名是否為空
MsgBox "沒有這個用戶", vbOKOnly + vbExclamation, ""
Text1.SetFocus
Else
sql = "select * from 系統信息 where user_ID='" & Combo1.Text & "'"
rs_login.Open sql, conn, adOpenKeyset, adLockPessimistic
If rs_login.EOF = True Then
MsgBox "沒有這個用戶", vbOKOnly + vbExclamation, ""
Text1.SetFocus
Else '檢驗密碼是否正確
If Trim(rs_login.Fields(1)) = Trim(Text1.Text) Then
userID = Combo1.Text
username = rs_login.Fields(2)
CurrentUser = rs_login("user_ID")
rs_login.Close
Unload Me
Form1.Show
Else
MsgBox "密碼不正確", vbOKOnly + vbExclamation, ""
Text1.SetFocus
End If
End If
End If
cnt = cnt + 1
If cnt = 3 Then
Unload Me
End If
End Sub
Private Sub command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Dim connectionstring As String
Dim rs As ADODB.Recordset
Dim t As Integer
Set rs = New ADODB.Recordset
connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path + "\number.mdb" + ";Persist Security Info=False" + ";Jet OLEDB:Database Password=li"
conn.Open connectionstring
cnt = 0
rs.Open "select user_id from 系統信息", connectionstring, adOpenStatic, adLockReadOnly
Dim i As String
For t = 0 To Val(rs.RecordCount) - 1
i = Trim(rs.Fields("user_id").Value)
rs.MoveNext
Combo1.AddItem i
Next t
rs.Close
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -