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

📄 frmshowgrade.frm

📁 数据库销售系统
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "msadodc.ocx"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "msdatgrd.ocx"
Begin VB.Form frmShowGrade 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "查询员工销售额"
   ClientHeight    =   7185
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6555
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   7185
   ScaleWidth      =   6555
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   330
      Left            =   120
      Top             =   6720
      Visible         =   0   'False
      Width           =   6135
      _ExtentX        =   10821
      _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=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.CommandButton cmdCancel 
      Caption         =   "取      消"
      Height          =   495
      Left            =   4440
      TabIndex        =   5
      Top             =   120
      Width           =   1575
   End
   Begin VB.Frame fraquery 
      Caption         =   "按员工号查询销售额"
      Height          =   1095
      Left            =   120
      TabIndex        =   1
      Top             =   720
      Width           =   6255
      Begin VB.CommandButton cmdquery 
         Caption         =   "查    询"
         Height          =   495
         Left            =   4320
         TabIndex        =   3
         Top             =   240
         Width           =   1575
      End
      Begin VB.TextBox txtNo 
         Height          =   375
         Left            =   1320
         TabIndex        =   2
         Top             =   360
         Width           =   2055
      End
      Begin VB.Label lblName 
         Caption         =   "员工号:"
         Height          =   375
         Left            =   120
         TabIndex        =   4
         Top             =   360
         Width           =   855
      End
   End
   Begin VB.CommandButton cmdallem 
      Caption         =   "显示全部员工销售额"
      Height          =   495
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   1935
   End
   Begin MSDataGridLib.DataGrid DataGrid1 
      Bindings        =   "frmShowGrade.frx":0000
      Height          =   4455
      Left            =   120
      TabIndex        =   6
      Top             =   2040
      Width           =   6255
      _ExtentX        =   11033
      _ExtentY        =   7858
      _Version        =   393216
      HeadLines       =   1
      RowHeight       =   15
      FormatLocked    =   -1  'True
      BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ColumnCount     =   3
      BeginProperty Column00 
         DataField       =   "业务员编号"
         Caption         =   "业务员编号"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column01 
         DataField       =   "员工姓名"
         Caption         =   "员工姓名"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column02 
         DataField       =   "销售总金额"
         Caption         =   "销售总金额"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      SplitCount      =   1
      BeginProperty Split0 
         BeginProperty Column00 
            ColumnWidth     =   915.024
         EndProperty
         BeginProperty Column01 
            ColumnWidth     =   1140.095
         EndProperty
         BeginProperty Column02 
            ColumnWidth     =   1739.906
         EndProperty
      EndProperty
   End
End
Attribute VB_Name = "frmShowGrade"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs_check As New ADODB.Recordset
Private Sub cmdallem_Click()
   allem = True
   'frmGrade.Show
   Call ShowGrade
End Sub

Private Sub cmdCancel_Click()
   Unload Me
End Sub

Private Sub cmdquery_Click()
   allem = False
   'frmGrade.Show
   Call ShowGrade
End Sub

Private Sub Form_Load()
    '让窗体居中
    Call MakeCenter(Me)
   
   Adodc1.ConnectionString = connStr
   
   allem = True
   Call ShowGrade
End Sub

Private Sub ShowGrade()
   If allem = False Then
      Dim strsql As String
      '下面的sql语句从sell表和employee表中显示特定员工号的员工号,员工姓名
      '并以员工号和员工姓名分组合计销售总额并显示之。
      strsql = "select 业务员编号,员工姓名,sum(总金额) as 销售总金额 " _
      & "from sell,employee where sell.业务员编号=employee.员工编号 " _
      & "and employee.员工编号 = " & frmShowGrade.txtNo.Text _
      & " group by 业务员编号,员工姓名"
      rs_check.Open strsql, conn, adOpenKeyset, adLockPessimistic
     Adodc1.CommandType = adCmdText
     Adodc1.RecordSource = strsql
     Adodc1.Refresh
      DataGrid1.ReBind
     
      If rs_check.EOF = True Then
          MsgBox "此员工号不存在!", vbOKOnly + vbInformation, "注意"
          rs_check.Close
          Unload Me
          Exit Sub
      End If
      
   Else
      strsql = "select 业务员编号,员工姓名,sum(总金额) " _
      & "as 销售总金额 from sell,employee where sell.业务员编号 " _
      & "=employee.员工编号 group by 业务员编号,员工姓名"
      
      rs_check.CursorLocation = adUseClient
      rs_check.Open strsql, conn, adOpenKeyset, adLockPessimistic
      Adodc1.CommandType = adCmdText
      Adodc1.RecordSource = strsql
      Adodc1.Refresh
      DataGrid1.ReBind
      
   End If
   DataGrid1.AllowAddNew = False                         '不可增加
   DataGrid1.AllowDelete = False                           '不可删除
   DataGrid1.AllowUpdate = False
   rs_check.Close
End Sub

⌨️ 快捷键说明

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