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

📄 form2.frm

📁 会员信息管理系统基于vb开发
💻 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 + -