xulangform.frm

来自「供销信息查询系统」· FRM 代码 · 共 221 行

FRM
221
字号
VERSION 5.00
Begin VB.Form xulangform 
   Caption         =   "狼人信息查询登录系统"
   ClientHeight    =   2790
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4620
   Icon            =   "xulangform.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2790
   ScaleWidth      =   4620
   StartUpPosition =   2  '屏幕中心
   Begin VB.CheckBox Check1 
      Caption         =   "匿名登录"
      Height          =   255
      Left            =   630
      TabIndex        =   7
      Top             =   2280
      Width           =   1095
   End
   Begin VB.CommandButton Command2 
      Caption         =   "取 消"
      Height          =   375
      Left            =   3360
      TabIndex        =   6
      Top             =   2280
      Width           =   855
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确 定"
      Height          =   375
      Left            =   2280
      TabIndex        =   5
      Top             =   2280
      Width           =   855
   End
   Begin VB.TextBox Text2 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      IMEMode         =   3  'DISABLE
      Left            =   1560
      PasswordChar    =   "*"
      TabIndex        =   0
      Top             =   1680
      Width           =   2415
   End
   Begin VB.TextBox Text1 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   1560
      TabIndex        =   3
      Text            =   "xulang"
      Top             =   1080
      Width           =   2415
   End
   Begin VB.Image Image1 
      Height          =   480
      Left            =   480
      Picture         =   "xulangform.frx":08CA
      Top             =   120
      Width           =   480
   End
   Begin VB.Label Label3 
      Caption         =   "密 码:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   600
      TabIndex        =   4
      Top             =   1680
      Width           =   1095
   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
      Height          =   255
      Left            =   600
      TabIndex        =   2
      Top             =   1080
      Width           =   1095
   End
   Begin VB.Line Line1 
      X1              =   360
      X2              =   4200
      Y1              =   840
      Y2              =   840
   End
   Begin VB.Label Label1 
      Caption         =   "狼人供销信息查询系统"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   1320
      TabIndex        =   1
      Top             =   240
      Width           =   2895
   End
End
Attribute VB_Name = "xulangForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private rs As New ADODB.Recordset
Private strsql As String
Private strconn As String

Private Sub Command1_Click()
If Text1.Text = "xulang" And Text2.Text = "xulang" Then
   xulang2 = 1
   loadform.Show
   Unload Me
   Exit Sub
End If
If Check1.Value = 1 Then
   che1 = 1
   loadform.Show
   Unload Me
Else
rs.MoveFirst
Do While Not rs.EOF
   If rs(0) = Text1.Text And rs(1) = Text2.Text Then
      loadform.Show
      Unload Me
      Exit Do
   End If
   rs.MoveNext
Loop
If rs.EOF Then
   MsgBox "请确认你是否有此权限。要不请用匿名登录。", , "用户名或密码错误提示"
   Text1.Text = ""
   Text2.Text = ""
   Text1.SetFocus
End If
End If
End Sub

Private Sub Command2_Click()
End
End Sub

Private Sub Form_Load()
che1 = 0
xulang1 = 1
strsql = "select * from xulang"
strconn = "provider=microsoft.jet.oledb.4.0;data source=" & App.Path & "\供销信息.mdb"
With rs
  If .State = adStateOpen Then
     .Close
  End If
  .ActiveConnection = strconn
  .LockType = adLockReadOnly
  .CursorLocation = adUseClient
  .CursorType = adOpenForwardOnly
  .Source = strsql
  .Open
End With
End Sub

Private Sub Form_Resize()
xulangForm.Height = 3195
xulangForm.Width = 4740
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
   Text2.SetFocus
End If
End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
If Text1.Text <> "" Then
If KeyAscii = 13 Then
   Call Command1_Click
End If
Else
MsgBox "请输入用户名或选择匿名登录", , "登录出错"
End If
End Sub

⌨️ 快捷键说明

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