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

📄 form1.frm

📁 用VB连接ORalce数据库的学生管理系统
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Frmload 
   Caption         =   "登录"
   ClientHeight    =   2670
   ClientLeft      =   3360
   ClientTop       =   2880
   ClientWidth     =   4725
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2670
   ScaleMode       =   0  'User
   ScaleWidth      =   4316.106
   Begin VB.CommandButton Command2 
      Height          =   300
      Left            =   3480
      Picture         =   "Form1.frx":0000
      Style           =   1  'Graphical
      TabIndex        =   7
      Top             =   2280
      Width           =   1095
   End
   Begin VB.CommandButton Command1 
      Height          =   300
      Left            =   2040
      Picture         =   "Form1.frx":055B
      Style           =   1  'Graphical
      TabIndex        =   6
      Top             =   2280
      Width           =   1095
   End
   Begin VB.Frame Frame1 
      Appearance      =   0  'Flat
      BackColor       =   &H00C0C0C0&
      ForeColor       =   &H80000008&
      Height          =   1575
      Left            =   120
      TabIndex        =   1
      Top             =   600
      Width           =   4455
      Begin VB.TextBox Text2 
         Appearance      =   0  'Flat
         BackColor       =   &H80000018&
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H000000FF&
         Height          =   350
         IMEMode         =   3  'DISABLE
         Left            =   1680
         PasswordChar    =   "*"
         TabIndex        =   3
         Top             =   960
         Width           =   2055
      End
      Begin VB.TextBox Text1 
         Appearance      =   0  'Flat
         BackColor       =   &H80000018&
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H000000FF&
         Height          =   350
         Left            =   1680
         TabIndex        =   2
         Top             =   360
         Width           =   2055
      End
      Begin VB.Label Label2 
         Caption         =   "密码:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   255
         Left            =   480
         TabIndex        =   5
         Top             =   960
         Width           =   975
      End
      Begin VB.Label Label1 
         Caption         =   "用户名:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   255
         Left            =   480
         TabIndex        =   4
         Top             =   360
         Width           =   975
      End
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   330
      Left            =   480
      Top             =   2280
      Visible         =   0   'False
      Width           =   1200
      _ExtentX        =   2117
      _ExtentY        =   582
      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         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   "he"
      Password        =   "he"
      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.Label Label3 
      Caption         =   "北京信息科技大学"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   15.75
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   375
      Left            =   1200
      TabIndex        =   0
      Top             =   240
      Width           =   2655
   End
   Begin VB.Image Image1 
      Height          =   480
      Left            =   480
      Picture         =   "Form1.frx":0B32
      Top             =   120
      Width           =   480
   End
End
Attribute VB_Name = "Frmload"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Static m As Integer
If m < 5 Then
    Dim i%
    If Text1.Text = "" Then
        MsgBox "用户名不能为空!", vbExclamation + vbOKOnly, "警告"
        Text1.SetFocus
        Exit Sub
    End If
    If Text2.Text = "" Then
        MsgBox "密码不能为空!", vbExclamation + vbOKOnly, "警告"
        Text2.SetFocus
        Exit Sub
    End If
    Adodc1.ConnectionString = "Provider=MSDAORA.1;User ID=he;Persist Security Info=False"
    sql = "select * from use where username='" & Trim(Text1.Text) & "'"
    Adodc1.CommandType = adCmdText
    Adodc1.RecordSource = sql
    Adodc1.Refresh

    If Adodc1.Recordset.EOF = True Then
        MsgBox " 用户名错误!", vbExclamation + vbOKOnly, "警告"
        Text1.SetFocus
        Text1.SelStart = 0
        Text1.SelLength = Len(Text1.Text)
        Exit Sub
    End If

    Adodc1.ConnectionString = "Provider=MSDAORA.1;User ID=he;Persist Security Info=False"
    Adodc1.CommandType = adCmdText
    Adodc1.RecordSource = "select * from use where username='" & Text1 & "' and password='" & Text2 & "'"
    Adodc1.Refresh
    If Adodc1.Recordset.EOF = False And Adodc1.Recordset.BOF = False Then
        mqx = Adodc1.Recordset.Fields("ident").Value
        MDIForm1.Show
        Unload Me
        Text1 = ""
        Text2 = ""
    Else
        If m < 4 Then
                m = m + 1
                If m = 4 Then
                    MsgBox "您是非法用户," + Chr(13) + Chr(10) + "请退出本系统!", 48, "警告"
                    Command1.Enabled = False
                    Exit Sub
                End If
            i = MsgBox("密码错误,请重试。", vbExclamation + vbOKOnly, "错误信息")
                Text2.Text = ""
                Text2.SetFocus
        End If
    End If
End If
End Sub

Private Sub Command2_Click()
Unload Me
End Sub




⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -