?? form1.frm
字號:
VERSION 5.00
Begin VB.Form denglu
BackColor = &H80000001&
Caption = "管理員登錄界面"
ClientHeight = 3840
ClientLeft = 60
ClientTop = 465
ClientWidth = 5460
LinkTopic = "Form1"
Picture = "Form1.frx":0000
ScaleHeight = 3840
ScaleWidth = 5460
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
BackColor = &H0000FF00&
Caption = "取消"
BeginProperty Font
Name = "華文行楷"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3480
MaskColor = &H000000FF&
Style = 1 'Graphical
TabIndex = 5
Top = 2640
UseMaskColor = -1 'True
Width = 1455
End
Begin VB.TextBox Text2
BeginProperty Font
Name = "隸書"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
IMEMode = 3 'DISABLE
Left = 2760
PasswordChar = "*"
TabIndex = 4
Top = 1560
Width = 2055
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "隸書"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2760
TabIndex = 2
Top = 480
Width = 2055
End
Begin VB.CommandButton Command1
BackColor = &H0000FF00&
Caption = "確定"
BeginProperty Font
Name = "華文行楷"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1080
MaskColor = &H000000FF&
Style = 1 'Graphical
TabIndex = 0
Top = 2640
UseMaskColor = -1 'True
Width = 1575
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "密 碼"
BeginProperty Font
Name = "隸書"
Size = 18
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 375
Left = 960
TabIndex = 3
Top = 1440
Width = 1335
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "用戶名"
BeginProperty Font
Name = "隸書"
Size = 18
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 495
Left = 960
TabIndex = 1
Top = 480
Width = 1335
End
End
Attribute VB_Name = "denglu"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public rs As New ADODB.Connection, cn As New ADODB.Connection
Private Sub Command1_Click()
Dim strSQL As String
strSQL = "select * from admin where admin_id='" & Text1.Text & "' and psw ='" & Text2.Text & "'"
Dim r As New ADODB.Recordset
r.Open strSQL, cn, adOpenDynamic
Static nTryCount As Integer
If r.EOF Then
MsgBox "對不起,輸入信息有誤!請重新輸入!!", vbCritical, "錯誤"
Text1.SetFocus
Text1.SelStart = 0
Text1.SelLength = Len(Text1)
nTryCount = nTryCount + 1
If nTryCount >= 3 Then
MsgBox "您無權操作本系統!再見!", vbCritical, "無權限"
Unload Me
End If
Else
Unload Me
mainfrm.Show
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
cn.ConnectionString = "Driver={SQL Server};SERVER=DDK;DATABASE=lvxingshe"
cn.Open
'MsgBox "連接成功"
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
On Error Resume Next
rs.Close
Set rs = Nothing
cn.Close
Set cn = Nothing
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -