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

📄 frmcardhang.frm

📁 数据库管理系统的实习内容
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmCardhang 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "一卡通挂失操作"
   ClientHeight    =   3060
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   4680
   Icon            =   "frmCardhang.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   3060
   ScaleWidth      =   4680
   Begin VB.CommandButton cmdRefresh 
      Caption         =   "刷新(&R)"
      Height          =   375
      Left            =   1920
      TabIndex        =   4
      Top             =   2400
      Width           =   975
   End
   Begin VB.CommandButton cmdCancel 
      Caption         =   "退出(&X)"
      Height          =   375
      Left            =   3360
      TabIndex        =   3
      Top             =   2400
      Width           =   855
   End
   Begin VB.CommandButton cmdHang 
      Caption         =   "挂失"
      Height          =   375
      Left            =   480
      TabIndex        =   2
      Top             =   2400
      Width           =   855
   End
   Begin VB.ComboBox comboStatue 
      Height          =   315
      Left            =   1560
      TabIndex        =   1
      Top             =   1440
      Width           =   2055
   End
   Begin VB.TextBox txtCardno 
      Height          =   375
      Left            =   1560
      TabIndex        =   0
      Top             =   600
      Width           =   1935
   End
   Begin VB.Frame Frame1 
      Caption         =   "挂失信息"
      Height          =   1815
      Left            =   480
      TabIndex        =   5
      Top             =   240
      Width           =   3735
      Begin VB.Label Label1 
         Caption         =   "卡号"
         Height          =   375
         Left            =   360
         TabIndex        =   7
         Top             =   480
         Width           =   855
      End
      Begin VB.Label Label2 
         Caption         =   "卡状态"
         Height          =   495
         Left            =   360
         TabIndex        =   6
         Top             =   1200
         Width           =   1095
      End
   End
End
Attribute VB_Name = "frmCardhang"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub cmdHang_Click()
    Dim mrc As ADODB.Recordset
    Dim MsgText As String
    Dim txtSQL As String
    
    If Not Testtxt(txtCardno.Text) Then
        MsgBox "请输入卡号!", vbOKOnly + vbExclamation, "提示您"
        txtCardno.SetFocus
        Exit Sub
    End If
    
    If Not IsNumeric(Trim(txtCardno.Text)) Then
        MsgBox "请输入数字!", vbOKOnly + vbExclamation, "提示您"
        Exit Sub
        txtCardno.SetFocus
    End If
    
    txtSQL = "select * from card_Info where card_ID='" & Trim(txtCardno) & "'"
    Set mrc = ExecuteSQL(txtSQL, MsgText)
    If mrc.EOF = True Then
            MsgBox "您的一卡通没有注册!", vbOKOnly + vbExclamation, "警告"
           txtCardno.SetFocus
           txtCardno.Text = ""
           txtCardno.SelStart = 0
           txtCardno.SelLength = Len(txtCardno)
           Exit Sub
    End If
    mrc.Close
    
    txtSQL = "select * from hang_Info where card_ID='" & Trim(txtCardno) & "'"
    Set mrc = ExecuteSQL(txtSQL, MsgText)
    If mrc.EOF = False Then
            MsgBox "您的一卡通已经挂失!", vbOKOnly + vbExclamation, "提示"
           txtCardno.SetFocus
           txtCardno.Text = ""
           txtCardno.SelStart = 0
           txtCardno.SelLength = Len(txtCardno)
            Exit Sub
    End If
    mrc.Close
    
    
    MsgBox "您的一卡通确定要挂失吗?", vbOKOnly + vbExclamation, "提示"
    comboStatue.ListIndex = 1
    comboStatue.Enabled = False
    
    txtSQL = "select * from hang_Info "
    Set mrc = ExecuteSQL(txtSQL, MsgText)
  
    mrc.AddNew
    mrc.Fields(0) = Trim(txtCardno.Text)
    mrc.Fields(1) = Trim(comboStatue.Text)
    mrc.Update
    mrc.Close
    MsgBox "您的一卡通挂失成功!", vbOKOnly + vbExclamation, "恭喜"
    
   
    
End Sub

Private Sub cmdCancel_Click()
    Unload Me
End Sub

Private Sub cmdRefresh_Click()
    txtCardno.Text = ""
    comboStatue.ListIndex = 0
    comboStatue.Enabled = False

End Sub

Private Sub Form_Load()
    Dim mrc As ADODB.Recordset
    Dim txtSQL As String
    Dim MsgText As String
    Dim i As Integer
    
    comboStatue.AddItem "正常"
    comboStatue.AddItem "挂失"
    comboStatue.ListIndex = 0
    comboStatue.Enabled = False
    
End Sub



Private Sub txtCard_Change()

End Sub

⌨️ 快捷键说明

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