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

📄 登录.frm

📁 基于VB6.0和SQL Server2000的课程设计
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form 登录 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "登录"
   ClientHeight    =   3525
   ClientLeft      =   45
   ClientTop       =   450
   ClientWidth     =   4695
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3525
   ScaleWidth      =   4695
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  '屏幕中心
   Begin VB.TextBox Text5 
      DataField       =   "WorkNo"
      DataSource      =   "Adodc1"
      Height          =   375
      Left            =   960
      TabIndex        =   11
      Text            =   "Text5"
      Top             =   4800
      Visible         =   0   'False
      Width           =   915
   End
   Begin VB.OptionButton Option3 
      Caption         =   "管理者"
      Height          =   315
      Left            =   3060
      TabIndex        =   10
      Top             =   1740
      Visible         =   0   'False
      Width           =   915
   End
   Begin VB.OptionButton Option2 
      Caption         =   "仓库管理"
      Height          =   315
      Left            =   1860
      TabIndex        =   9
      Top             =   1740
      Visible         =   0   'False
      Width           =   1095
   End
   Begin VB.OptionButton Option1 
      Caption         =   "销售员"
      Height          =   255
      Left            =   840
      TabIndex        =   8
      Top             =   1800
      Visible         =   0   'False
      Width           =   915
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   330
      Left            =   3840
      Top             =   4260
      Visible         =   0   'False
      Width           =   1200
      _ExtentX        =   2117
      _ExtentY        =   582
      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=   3
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   "DSN=Medicine"
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   "Medicine"
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   "select * from userinfor"
      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.TextBox Text4 
      DataField       =   "Password"
      DataSource      =   "Adodc1"
      Height          =   315
      Left            =   2520
      TabIndex        =   7
      Text            =   "Text4"
      Top             =   4260
      Visible         =   0   'False
      Width           =   1095
   End
   Begin VB.TextBox Text3 
      DataField       =   "UserRegName"
      DataSource      =   "Adodc1"
      Height          =   330
      Left            =   960
      TabIndex        =   6
      Text            =   "Text3"
      Top             =   4200
      Visible         =   0   'False
      Width           =   1035
   End
   Begin VB.CommandButton Command2 
      Caption         =   "取消"
      Height          =   495
      Left            =   2340
      TabIndex        =   5
      Top             =   2220
      Width           =   1215
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确定"
      Height          =   495
      Left            =   780
      TabIndex        =   4
      Top             =   2220
      Width           =   1215
   End
   Begin VB.TextBox Text2 
      Height          =   315
      IMEMode         =   3  'DISABLE
      Left            =   2160
      PasswordChar    =   "*"
      TabIndex        =   3
      Top             =   1200
      Width           =   1635
   End
   Begin VB.TextBox Text1 
      Height          =   315
      Left            =   2160
      TabIndex        =   2
      Top             =   600
      Width           =   1635
   End
   Begin VB.Label Label2 
      Caption         =   "密码:"
      Height          =   255
      Left            =   840
      TabIndex        =   1
      Top             =   1260
      Width           =   1335
   End
   Begin VB.Label Label1 
      Caption         =   "用户名:"
      Height          =   315
      Left            =   840
      TabIndex        =   0
      Top             =   660
      Width           =   1335
   End
End
Attribute VB_Name = "登录"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public A, B, C

Private Sub Command1_Click()
Dim x As String, y As String
Text1.SetFocus
If Val(Text2.Text) = Val(Text4.Text) Then
MsgBox "输入正确", , "提示"
Text1.Text = ""
Text2.Text = ""
Unload Me
  If A = 1 Then
   FrmMain.A2.Enabled = True
   FrmMain.A3.Enabled = True
   End If
  If B = 1 Then
   FrmMain.B2.Enabled = True
   End If
  If C = 1 Then
   FrmMain.C2.Enabled = True
   FrmMain.C3.Enabled = True
   FrmMain.C4.Enabled = True
   FrmMain.C5.Enabled = True
   End If
Else
  MsgBox "密码错误", , "提示"
End If
End Sub

Private Sub Command2_Click()
Me.Hide
End Sub

Private Sub Form_Load()
If A = 1 Then
Adodc1.RecordSource = "select * from power1 where userregname= '" & Text1 & "'"
Adodc1.Refresh
End If
If B = 1 Then
Adodc1.RecordSource = "select * from power2 where userregname= '" & Text1 & "'"
Adodc1.Refresh
End If
If C = 1 Then
Adodc1.RecordSource = "select * from power3 where userregname= '" & Text1 & "'"
Adodc1.Refresh
End If
End Sub

Private Sub Option1_Click()
A = 1
End Sub

Private Sub Option2_Click()
B = 1
End Sub

Private Sub Option3_Click()
C = 1
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = Chr(32) Then
Text2.SetFocus
End If
End Sub
Private Sub Text2_GotFocus()
If A = 1 Then
Adodc1.RecordSource = "select * from power1 where userregname= '" & Text1 & "'"
Adodc1.Refresh
End If
If B = 1 Then
Adodc1.RecordSource = "select * from power2 where userregname= '" & Text1 & "'"
Adodc1.Refresh
End If
If C = 1 Then
Adodc1.RecordSource = "select * from power3 where userregname= '" & Text1 & "'"
Adodc1.Refresh
End If
If Adodc1.Recordset.EOF Then
MsgBox "无此用户,请重新输入!", , "提示"
Text1.Text = ""
Text1.SetFocus
End If
End Sub

⌨️ 快捷键说明

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