⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.frm

📁 本系统以VB为开发工具
💻 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 + -