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

📄 frmdock.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 frmDock 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "仓库管理"
   ClientHeight    =   6555
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   9810
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   6555
   ScaleWidth      =   9810
   StartUpPosition =   1  '所有者中心
   Begin VB.CommandButton Command4 
      Caption         =   "退出"
      Height          =   375
      Left            =   8400
      TabIndex        =   9
      Top             =   1560
      Width           =   1215
   End
   Begin VB.CommandButton Command3 
      Caption         =   "修改"
      Height          =   375
      Left            =   6480
      TabIndex        =   8
      Top             =   1560
      Width           =   975
   End
   Begin VB.CommandButton Command2 
      Caption         =   "删除"
      Height          =   375
      Left            =   5280
      TabIndex        =   7
      Top             =   1560
      Width           =   1095
   End
   Begin VB.CommandButton Command1 
      Caption         =   "添加"
      Height          =   375
      Left            =   3960
      TabIndex        =   6
      Top             =   1560
      Width           =   1215
   End
   Begin VB.TextBox Text5 
      Height          =   375
      Left            =   4680
      TabIndex        =   5
      Top             =   840
      Width           =   1815
   End
   Begin VB.TextBox Text4 
      Height          =   375
      Left            =   4680
      TabIndex        =   4
      Top             =   240
      Width           =   1815
   End
   Begin VB.TextBox Text3 
      Height          =   375
      Left            =   1200
      TabIndex        =   3
      Top             =   1440
      Width           =   1935
   End
   Begin VB.TextBox Text2 
      Height          =   375
      Left            =   1200
      TabIndex        =   2
      Top             =   840
      Width           =   1935
   End
   Begin VB.TextBox Text1 
      Height          =   375
      Left            =   1200
      TabIndex        =   1
      Top             =   240
      Width           =   1935
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   375
      Left            =   7560
      Top             =   240
      Visible         =   0   'False
      Width           =   1455
      _ExtentX        =   2566
      _ExtentY        =   661
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   2
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=dock.mdb;Persist Security Info=False;Jet OLEDB:Database Password=xiao"
      OLEDBString     =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=dock.mdb;Persist Security Info=False;Jet OLEDB:Database Password=xiao"
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   "仓库表"
      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
   Begin MSDataGridLib.DataGrid DataGrid1 
      Bindings        =   "frmDock.frx":0000
      Height          =   4215
      Left            =   120
      TabIndex        =   0
      Top             =   2160
      Width           =   9495
      _ExtentX        =   16748
      _ExtentY        =   7435
      _Version        =   393216
      AllowUpdate     =   0   'False
      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     =   6
      BeginProperty Column00 
         DataField       =   "ID"
         Caption         =   "ID"
         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
      SplitCount      =   1
      BeginProperty Split0 
         BeginProperty Column00 
            Object.Visible         =   0   'False
            ColumnWidth     =   1094.74
         EndProperty
         BeginProperty Column01 
            ColumnWidth     =   1260.284
         EndProperty
         BeginProperty Column02 
            ColumnWidth     =   3240
         EndProperty
         BeginProperty Column03 
         EndProperty
         BeginProperty Column04 
            ColumnWidth     =   929.764
         EndProperty
         BeginProperty Column05 
            ColumnWidth     =   2085.166
         EndProperty
      EndProperty
   End
   Begin VB.Label Label5 
      Caption         =   "数量"
      Height          =   375
      Left            =   3600
      TabIndex        =   14
      Top             =   840
      Width           =   855
   End
   Begin VB.Label Label4 
      Caption         =   "单位"
      Height          =   375
      Left            =   3600
      TabIndex        =   13
      Top             =   240
      Width           =   975
   End
   Begin VB.Label Label3 
      Caption         =   "单价"
      Height          =   375
      Left            =   120
      TabIndex        =   12
      Top             =   1440
      Width           =   855
   End
   Begin VB.Label Label2 
      Caption         =   "名称"
      Height          =   375
      Left            =   120
      TabIndex        =   11
      Top             =   840
      Width           =   855
   End
   Begin VB.Label Label1 
      Caption         =   "编号"
      Height          =   375
      Left            =   120
      TabIndex        =   10
      Top             =   240
      Width           =   975
   End
End
Attribute VB_Name = "frmDock"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
    If Text1 <> "" And Text2 <> "" And Text3 <> "" And Text4 <> "" And Text5 <> "" Then
        With Adodc1.Recordset
            .AddNew
            .Fields(1).Value = Text1.Text
            .Fields(2).Value = Text2.Text
            .Fields(3).Value = Text3.Text
            .Fields(4).Value = Text4.Text
            .Fields(5).Value = Text5.Text
            If Not .EOF Then .MoveNext
            .Requery
        End With
    Else
        MsgBox "数据不全!"
    End If
End Sub

Private Sub Command2_Click()
    With Adodc1.Recordset
        If Not .EOF Then
            .Delete
            .MoveNext
            .Requery
        End If
    End With
End Sub

Private Sub Command3_Click()
    If Text1 <> "" And Text2 <> "" And Text3 <> "" And Text4 <> "" And Text5 <> "" Then
        With Adodc1.Recordset
            If Not .EOF Then
                .Fields(1).Value = Text1.Text
                .Fields(2).Value = Text2.Text
                .Fields(3).Value = Text3.Text
                .Fields(4).Value = Text4.Text
                .Fields(5).Value = Text5.Text
                .Update
            End If
        End With
    Else
        MsgBox "数据不全!"
    End If
End Sub

Private Sub Command4_Click()
    Unload Me
End Sub

Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
    On Error Resume Next
    With Adodc1.Recordset
        Text1.Text = .Fields(1).Value
        Text2.Text = .Fields(2).Value
        Text3.Text = .Fields(3).Value
        Text4.Text = .Fields(4).Value
        Text5.Text = .Fields(5).Value
    End With
End Sub
Private Sub Form_Load()
    With Adodc1
        .CommandType = adCmdText
        .ConnectionString = getDbStr
        .RecordSource = "select * from 仓库表"
        .Refresh
    End With
    DataGrid1.Columns.Item(0).Width = 0
End Sub

Private Sub Text1_Change()
    Call delErr(Text1)
    Call chkTxt(Text1)
End Sub
Private Sub Text2_Change()
    Call chkTxt(Text2)
End Sub
Private Sub Text3_Change()
    Call chkTxt(Text3)
End Sub
Private Sub Text4_Change()
    Call chkTxt(Text4)
End Sub
Private Sub Text5_Change()
    Call chkTxt(Text5)
End Sub

⌨️ 快捷键说明

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