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

📄 frmsbxicx.frm

📁 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 frmSBXXCX 
   BackColor       =   &H00FF0000&
   Caption         =   "设备信息查询"
   ClientHeight    =   5850
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   11880
   FillColor       =   &H00FF0000&
   BeginProperty Font 
      Name            =   "宋体"
      Size            =   10.5
      Charset         =   134
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   5850
   ScaleWidth      =   11880
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton Command4 
      Caption         =   "退   出"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   10.5
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   11160
      Picture         =   "frmSBXICX.frx":0000
      Style           =   1  'Graphical
      TabIndex        =   12
      Top             =   5400
      Width           =   1335
   End
   Begin VB.CommandButton Command3 
      BackColor       =   &H00C00000&
      Caption         =   "刷   新"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   10.5
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   4440
      Picture         =   "frmSBXICX.frx":0B25
      Style           =   1  'Graphical
      TabIndex        =   11
      Top             =   5400
      Width           =   1335
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   375
      Left            =   7320
      Top             =   5400
      Width           =   2295
      _ExtentX        =   4048
      _ExtentY        =   661
      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       =   65535
      ForeColor       =   12582912
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin MSDataGridLib.DataGrid DataGrid1 
      Height          =   4935
      Left            =   3480
      TabIndex        =   8
      Top             =   240
      Width           =   9615
      _ExtentX        =   16960
      _ExtentY        =   8705
      _Version        =   393216
      BackColor       =   65535
      HeadLines       =   1
      RowHeight       =   15
      BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ColumnCount     =   2
      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
      SplitCount      =   1
      BeginProperty Split0 
         BeginProperty Column00 
         EndProperty
         BeginProperty Column01 
         EndProperty
      EndProperty
   End
   Begin VB.Frame Frame3 
      Caption         =   "查询方式选择"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000C0&
      Height          =   5655
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   3255
      Begin VB.OptionButton Option2 
         Caption         =   "  按设备状态查询"
         BeginProperty Font 
            Name            =   "楷体_GB2312"
            Size            =   10.5
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   255
         Left            =   600
         TabIndex        =   10
         Top             =   3000
         Width           =   2295
      End
      Begin VB.OptionButton Option5 
         Caption         =   "  按设备编号"
         BeginProperty Font 
            Name            =   "楷体_GB2312"
            Size            =   10.5
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   255
         Left            =   600
         TabIndex        =   9
         Top             =   600
         Width           =   1695
      End
      Begin VB.CommandButton Command2 
         Caption         =   "打 印"
         BeginProperty Font 
            Name            =   "楷体_GB2312"
            Size            =   10.5
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Index           =   0
         Left            =   1920
         Picture         =   "frmSBXICX.frx":164A
         Style           =   1  'Graphical
         TabIndex        =   7
         Top             =   5040
         Width           =   975
      End
      Begin VB.CommandButton Command1 
         Caption         =   "查 询"
         BeginProperty Font 
            Name            =   "楷体_GB2312"
            Size            =   10.5
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Index           =   2
         Left            =   360
         Picture         =   "frmSBXICX.frx":216F
         Style           =   1  'Graphical
         TabIndex        =   6
         Top             =   5040
         Width           =   975
      End
      Begin VB.TextBox Text1 
         BackColor       =   &H00FFC0C0&
         Height          =   315
         Index           =   8
         Left            =   600
         TabIndex        =   5
         Top             =   4320
         Width           =   2055
      End
      Begin VB.OptionButton Option4 
         Caption         =   "  按使用寿命查询"
         BeginProperty Font 
            Name            =   "楷体_GB2312"
            Size            =   10.5
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   255
         Left            =   600
         TabIndex        =   3
         Top             =   1800
         Width           =   2295
      End
      Begin VB.OptionButton Option3 
         Caption         =   "  按购买时间查询"
         BeginProperty Font 
            Name            =   "楷体_GB2312"
            Size            =   10.5
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   255
         Left            =   600
         TabIndex        =   2
         Top             =   2400
         Width           =   2295
      End
      Begin VB.OptionButton Option1 
         Caption         =   "  按设备名称查询"
         BeginProperty Font 
            Name            =   "楷体_GB2312"
            Size            =   10.5
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   255
         Left            =   600
         TabIndex        =   1
         Top             =   1200
         Width           =   2295
      End
      Begin VB.Label Label5 
         Caption         =   "请输入要查询的关键字:"
         BeginProperty Font 
            Name            =   "楷体_GB2312"
            Size            =   10.5
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C00000&
         Height          =   375
         Index           =   1
         Left            =   480
         TabIndex        =   4
         Top             =   3720
         Width           =   2415
      End
   End
End
Attribute VB_Name = "frmSBXXCX"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim db As ADODB.Connection
Dim rs As ADODB.Recordset

Private Sub Command1_Click(Index As Integer)
 If Option1.Value = True Then
 On Error Resume Next
 rs.Close
 rs.Open "select * from 设备信息 where 设备名称 like " & "'%" & Text1(8).Text & "%'", db, adOpenStatic, adLockReadOnly
Set DataGrid1.DataSource = rs
End If
 If Option5.Value = True Then
  On Error Resume Next
 rs.Close
 rs.Open "select * from 设备信息  where 设备编号 like " & "'%" & Text1(8).Text & "%'", db, adOpenStatic, adLockReadOnly
Set DataGrid1.DataSource = rs
End If
If Option4.Value = True Then
  On Error Resume Next
 rs.Close
 rs.Open "select * from 设备信息  where 设备使用寿命 like " & "'%" & Text1(8).Text & "%'", db, adOpenStatic, adLockReadOnly
Set DataGrid1.DataSource = rs
End If
If Option3.Value = True Then
  On Error Resume Next
 rs.Close
 rs.Open "select * from 设备信息  where 设备购买时间 like " & "'%" & Text1(8).Text & "%'", db, adOpenStatic, adLockReadOnly
Set DataGrid1.DataSource = rs
End If

If Option2.Value = True Then
  On Error Resume Next
 rs.Close
 rs.Open "select * from 设备信息  where 设备状态 like " & "'%" & Text1(8).Text & "%'", db, adOpenStatic, adLockReadOnly
Set DataGrid1.DataSource = rs
End If
End Sub

Private Sub Command3_Click()
     rs.Close
     rs.Open "select * from 设备信息", db, adOpenStatic, adLockReadOnly
   Set DataGrid1.DataSource = Adodc1
End Sub

Private Sub Command4_Click()
Unload Me
End Sub

Private Sub Form_Load()
 Set db = New ADODB.Connection
 Set rs = New ADODB.Recordset
 db.ConnectionString = "driver={SQL Server};server=MAINSRV;database=物流系统"
 db.Open
 rs.Open "select * from 设备信息", db, adOpenStatic, adLockReadOnly

Me.Hide
frmSBXXCX.Show

With Adodc1
    .ConnectionString = "driver={SQL Server};server=MAINSRV;database=物流系统"
    .RecordSource = "select * from 设备信息"
End With
Set DataGrid1.DataSource = Adodc1
End Sub

Private Sub Form_Unload(Cancel As Integer)
Me.Hide
MDIPSZX.Show
End Sub

⌨️ 快捷键说明

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