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

📄 main_jbxx_spll.frm

📁 基于VB + SQL Server 的商品进销管理,是学习VB数据库编程的重要参考
💻 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 main_jbxx_spll 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "基本信息管理-【商品信息管理】"
   ClientHeight    =   5715
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   8730
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   5715
   ScaleWidth      =   8730
   StartUpPosition =   1  '所有者中心
   Begin VB.CommandButton CmdDelete 
      BackColor       =   &H00C0C0C0&
      Caption         =   "[D]删除"
      Height          =   360
      Left            =   3450
      Style           =   1  'Graphical
      TabIndex        =   6
      Top             =   5295
      Width           =   1710
   End
   Begin VB.CommandButton CmdModify 
      BackColor       =   &H00C0C0C0&
      Caption         =   "[M]修改"
      Height          =   360
      Left            =   1755
      Style           =   1  'Graphical
      TabIndex        =   8
      Top             =   5295
      Width           =   1710
   End
   Begin VB.CommandButton CmdExit 
      BackColor       =   &H00C0C0C0&
      Caption         =   "[X]退出"
      Height          =   360
      Left            =   5835
      Style           =   1  'Graphical
      TabIndex        =   7
      Top             =   5295
      Width           =   2865
   End
   Begin VB.CommandButton CmdAdd 
      BackColor       =   &H00C0C0C0&
      Caption         =   "[A]添加"
      Height          =   360
      Left            =   60
      Style           =   1  'Graphical
      TabIndex        =   5
      Top             =   5295
      Width           =   1710
   End
   Begin VB.Frame Frame3 
      Height          =   660
      Left            =   15
      TabIndex        =   1
      Top             =   30
      Width           =   8685
      Begin VB.ComboBox CboOp 
         Height          =   300
         ItemData        =   "main_jbxx_spll.frx":0000
         Left            =   1905
         List            =   "main_jbxx_spll.frx":0002
         TabIndex        =   9
         Top             =   225
         Width           =   765
      End
      Begin VB.ComboBox CboFields 
         Height          =   300
         ItemData        =   "main_jbxx_spll.frx":0004
         Left            =   105
         List            =   "main_jbxx_spll.frx":0006
         TabIndex        =   4
         Top             =   225
         Width           =   1785
      End
      Begin VB.CommandButton CmdFind 
         BackColor       =   &H00C0C0C0&
         Caption         =   "查询"
         Height          =   330
         Left            =   6885
         TabIndex        =   3
         Top             =   210
         Width           =   1710
      End
      Begin VB.TextBox TxtExpression 
         Height          =   300
         Left            =   2700
         TabIndex        =   2
         Top             =   225
         Width           =   4110
      End
   End
   Begin MSDataGridLib.DataGrid DataGrid1 
      Bindings        =   "main_jbxx_spll.frx":0008
      Height          =   4500
      Left            =   15
      TabIndex        =   0
      Top             =   720
      Width           =   8640
      _ExtentX        =   15240
      _ExtentY        =   7938
      _Version        =   393216
      AllowUpdate     =   0   'False
      BackColor       =   14737632
      HeadLines       =   1
      RowHeight       =   15
      FormatLocked    =   -1  'True
      BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ColumnCount     =   8
      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
      BeginProperty Column03 
         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 Column04 
         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 Column05 
         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 Column06 
         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 Column07 
         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     =   2085.166
         EndProperty
         BeginProperty Column02 
            ColumnWidth     =   2085.166
         EndProperty
         BeginProperty Column03 
            ColumnWidth     =   2085.166
         EndProperty
         BeginProperty Column04 
            ColumnWidth     =   2085.166
         EndProperty
         BeginProperty Column05 
            ColumnWidth     =   1005.165
         EndProperty
         BeginProperty Column06 
            ColumnWidth     =   2085.166
         EndProperty
         BeginProperty Column07 
            ColumnWidth     =   2085.166
         EndProperty
      EndProperty
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   330
      Left            =   -780
      Top             =   1755
      Visible         =   0   'False
      Width           =   1620
      _ExtentX        =   2858
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   1
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=XSGL"
      OLEDBString     =   "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=XSGL"
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   "select * from 商品信息表"
      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
End
Attribute VB_Name = "main_jbxx_spll"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub CmdExit_Click()
  Call CmdEnd(Me)
End Sub

Private Sub Form_Load()
  '向cboOperators组合框中加入查询所需要使用的运算符号
  cboOperators CboOp
  '通过传递进来的SQL语句,取得表的各个字段的结构
  Dim rs As New ADODB.Recordset
  rs.Open "select * from 商品信息表", Cnn, adOpenKeyset, adLockReadOnly
  '将字段填入到字段列表中
  Dim fld
  For Each fld In rs.Fields
      CboFields.AddItem fld.Name
  Next fld
  rs.Close
  CboFields.ListIndex = 0
End Sub
Private Sub CmdAdd_Click()
  Dim bh As Long
  Dim rs1 As New ADODB.Recordset
  rs1.Open "select * from 商品信息表 order by 商品编号", Cnn, adOpenKeyset, adLockOptimistic
  If rs1.RecordCount > 0 Then
     If rs1.EOF = False Then rs1.MoveLast
     bh = Val(rs1.Fields("商品编号")) + 1
     main_jbxx_spinf.Text1(0).Text = Format(bh, "00000")
  Else
     main_jbxx_spinf.Text1(0).Text = "00001"
  End If
  Load main_jbxx_spinf
  main_jbxx_spinf.Show
End Sub
Private Sub CmdFind_Click()
  If CboOp.Text = "Like" Then
     Adodc1.RecordSource = "select * from 商品信息表 where " & CboFields.Text & " " & CboOp.Text & " '%" & TxtExpression.Text & "%'"
     Adodc1.Refresh
  Else
     Adodc1.RecordSource = "select * from 商品信息表 where " & CboFields.Text & " " & CboOp.Text & " '" & TxtExpression.Text & "'"
     Adodc1.Refresh
  End If
End Sub
Private Sub CmdModify_Click()
  For i = 0 To 7
      '对应列
      DataGrid1.Col = i
      main_jbxx_spinf.Text1(i) = DataGrid1.Text
  Next i
  Load main_jbxx_spinf
  main_jbxx_spinf.Show
End Sub
Private Sub CmdDelete_Click()
  Dim a As String
  If Adodc1.Recordset.RecordCount > 0 Then
     a = MsgBox("您确实要删除这条数据吗?", vbYesNo)
     If a = vbYes Then
        Adodc1.Recordset.Delete
        Adodc1.Refresh
     End If
  Else
     MsgBox ("没有要删除的数据!")
  End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
  Call CmdEnd(Me)
End Sub

⌨️ 快捷键说明

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