VERSION 5.00
Object = "{22D6F304-B0F6-11D0-94AB-0080C74C7E95}#1.0#0"; "MSDXM.OCX"
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form frmMain 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "影片管理器"
   ClientHeight    =   6135
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   7410
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   6135
   ScaleWidth      =   7410
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton cmdFill 
      Caption         =   "全屏"
      Height          =   375
      Left            =   6390
      TabIndex        =   22
      Top             =   4800
      Width           =   855
   End
   Begin VB.CommandButton cmdExit 
      Caption         =   "退出"
      Height          =   375
      Left            =   5880
      TabIndex        =   21
      Top             =   5280
      Width           =   855
   End
   Begin VB.CommandButton cmdPlay 
      Caption         =   "播放"
      Height          =   375
      Left            =   5370
      TabIndex        =   20
      Top             =   4800
      Width           =   855
   End
   Begin VB.CommandButton cmdBrow 
      Caption         =   "浏览影片库"
      Height          =   375
      Left            =   3240
      TabIndex        =   19
      Top             =   5280
      Width           =   1935
   End
   Begin VB.CommandButton cmdDelFilm 
      Caption         =   "删除"
      Height          =   375
      Left            =   4320
      TabIndex        =   18
      Top             =   4800
      Width           =   855
   End
   Begin VB.CommandButton cmdAddFilm 
      Caption         =   "添加"
      Height          =   375
      Left            =   3240
      TabIndex        =   17
      Top             =   4800
      Width           =   855
   End
   Begin VB.Frame Frame2 
      Caption         =   "查找"
      Height          =   1740
      Left            =   135
      TabIndex        =   9
      Top             =   4200
      Width           =   2655
      Begin VB.CommandButton cmdQuery 
         Caption         =   "查找影片"
         Height          =   375
         Left            =   480
         TabIndex        =   16
         Top             =   1320
         Width           =   1335
      End
      Begin VB.TextBox txtQryNum 
         Height          =   270
         Left            =   600
         TabIndex        =   12
         Top             =   240
         Width           =   975
      End
      Begin VB.TextBox txtQryName 
         Height          =   270
         Left            =   600
         TabIndex        =   11
         Top             =   600
         Width           =   1815
      End
      Begin VB.TextBox txtQryTime 
         Height          =   270
         Left            =   1320
         TabIndex        =   10
         Top             =   960
         Width           =   1095
      End
      Begin VB.Label Label5 
         Caption         =   "编号:"
         Height          =   255
         Left            =   120
         TabIndex        =   15
         Top             =   225
         Width           =   495
      End
      Begin VB.Label Label6 
         Caption         =   "片名:"
         Height          =   255
         Left            =   120
         TabIndex        =   14
         Top             =   570
         Width           =   495
      End
      Begin VB.Label Label7 
         Caption         =   "上次观看时间"
         Height          =   255
         Left            =   120
         TabIndex        =   13
         Top             =   960
         Width           =   1095
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "影片信息"
      Height          =   3900
      Left            =   165
      TabIndex        =   0
      Top             =   135
      Width           =   2655
      Begin VB.TextBox txtIntro 
         CausesValidation=   0   'False
         DataField       =   "影片介绍"
         DataSource      =   "Adodc1"
         Height          =   1695
         Left            =   225
         MultiLine       =   -1  'True
         ScrollBars      =   2  'Vertical
         TabIndex        =   7
         Top             =   1665
         Width           =   2175
      End
      Begin VB.TextBox txtLastTime 
         CausesValidation=   0   'False
         DataField       =   "上次观看时间"
         DataSource      =   "Adodc1"
         Height          =   270
         Left            =   1320
         TabIndex        =   5
         Top             =   1035
         Width           =   1095
      End
      Begin VB.TextBox txtName 
         CausesValidation=   0   'False
         DataField       =   "片名"
         DataSource      =   "Adodc1"
         Height          =   270
         Left            =   720
         TabIndex        =   3
         Top             =   675
         Width           =   1695
      End
      Begin VB.TextBox txtNum 
         DataField       =   "编号"
         DataSource      =   "Adodc1"
         Enabled         =   0   'False
         Height          =   270
         Left            =   720
         TabIndex        =   1
         Top             =   315
         Width           =   975
      End
      Begin MSAdodcLib.Adodc Adodc1 
         Height          =   330
         Left            =   270
         Top             =   3465
         Width           =   2100
         _ExtentX        =   3704
         _ExtentY        =   582
         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         =   $"frmMain.frx":0000
         OLEDBString     =   $"frmMain.frx":0089
         OLEDBFile       =   ""
         DataSourceName  =   ""
         OtherAttributes =   ""
         UserName        =   ""
         Password        =   ""
         RecordSource    =   "影片信息"
         Caption         =   "影片浏览"
         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 VB.Label Label4 
         Caption         =   "影片说明:"
         Height          =   255
         Left            =   240
         TabIndex        =   8
         Top             =   1425
         Width           =   1095
      End
      Begin VB.Label Label3 
         Caption         =   "上次观看时间"
         Height          =   255
         Left            =   120
         TabIndex        =   6
         Top             =   1035
         Width           =   1095
      End
      Begin VB.Label Label2 
         Caption         =   "片名:"
         Height          =   255
         Left            =   240
         TabIndex        =   4
         Top             =   675
         Width           =   495
      End
      Begin VB.Label Label1 
         Caption         =   "编号:"
         Height          =   255
         Left            =   240
         TabIndex        =   2
         Top             =   315
         Width           =   495
      End
   End
   Begin MediaPlayerCtl.MediaPlayer MediaPlayer1 
      Height          =   3855
      Left            =   2865
      TabIndex        =   23
      Top             =   240
      Width           =   4320
      AudioStream     =   -1
      AutoSize        =   0   'False
      AutoStart       =   -1  'True
      AnimationAtStart=   -1  'True
      AllowScan       =   -1  'True
      AllowChangeDisplaySize=   -1  'True
      AutoRewind      =   0   'False
      Balance         =   0
      BaseURL         =   ""
      BufferingTime   =   5
      CaptioningID    =   ""
      ClickToPlay     =   -1  'True
      CursorType      =   0
      CurrentPosition =   -1
      CurrentMarker   =   0
      DefaultFrame    =   ""
      DisplayBackColor=   0
      DisplayForeColor=   16777215
      DisplayMode     =   0
      DisplaySize     =   4
      Enabled         =   -1  'True
      EnableContextMenu=   -1  'True
      EnablePositionControls=   -1  'True
      EnableFullScreenControls=   0   'False
      EnableTracker   =   -1  'True
      Filename        =   ""
      InvokeURLs      =   -1  'True
      Language        =   -1
      Mute            =   0   'False
      PlayCount       =   1
      PreviewMode     =   0   'False
      Rate            =   1
      SAMILang        =   ""
      SAMIStyle       =   ""
      SAMIFileName    =   ""
      SelectionStart  =   -1
      SelectionEnd    =   -1
      SendOpenStateChangeEvents=   -1  'True
      SendWarningEvents=   -1  'True
      SendErrorEvents =   -1  'True
      SendKeyboardEvents=   0   'False
      SendMouseClickEvents=   0   'False
      SendMouseMoveEvents=   0   'False
      SendPlayStateChangeEvents=   -1  'True
      ShowCaptioning  =   0   'False
      ShowControls    =   -1  'True
      ShowAudioControls=   -1  'True
      ShowDisplay     =   0   'False
      ShowGotoBar     =   0   'False
      ShowPositionControls=   -1  'True
      ShowStatusBar   =   0   'False
      ShowTracker     =   -1  'True
      TransparentAtStart=   0   'False
      VideoBorderWidth=   0
      VideoBorderColor=   0
      VideoBorder3D   =   -1  'True
      Volume          =   -230
      WindowlessVideo =   0   'False
   End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False


Private Sub cmdAddFilm_Click()
    frmAdd.Show     '显示“添加影片”窗体
    Me.Hide         '隐藏本窗体
End Sub

Private Sub cmdBrow_Click()
    frmBrow.Show    '显示“影片库浏览”窗体
    Me.Hide         '隐藏本窗体
End Sub

Private Sub cmdDelFilm_Click()
    Dim flag As Integer     '设置临时的标志变量，用于记录对话框返回值
    flag = MsgBox(rsFilm.Fields("片名") + " 将从数据库中删除,确定要这样做吗?", _
                    vbYesNo, "删除影片")
    If flag = vbYes Then    '判断在对话框中是否选择“是”按钮
        rsFilm.Delete       '删除当前记录
        rsFilm.Resync       '刷新记录
    End If
End Sub

Private Sub cmdExit_Click()
    End               '退出程序
End Sub

Private Sub cmdFill_Click()
    If MediaPlayer1.PlayState = mpPlaying Then  '检测影片是否正在播放
        MediaPlayer1.DisplaySize = mpFullScreen     '将正在播放的影片放大到全屏
    Else
        MsgBox "请先播放影片!"
    End If
End Sub

Public Sub cmdPlay_Click()
On Error GoTo ErrFile       '启动错误捕获
    MediaPlayer1.FileName = rsFilm.Fields("存储路径")   '载入要播放的影片
    MediaPlayer1.Play       '播放影片
    Exit Sub                '退出过程

ErrFile:                    '设置错误处理标号
    MsgBox "文件不存在或路径错误!"
End Sub

Private Sub cmdQuery_Click()
On Error GoTo ErrQuery                          '启动错误捕获
    If txtQryNum.Text <> "" Then                '判断编号框是否为空
         rsFilm.Filter = "编号 = " + txtQryNum  '按编号查询
    ElseIf txtQryName.Text <> "" Then           '判断片名框是否为空
         rsFilm.Filter = " 片名 = '" + txtQryName + "'" '按片名查询
    ElseIf txtQryTime.Text <> "" Then           '判断上次观看时间框是否为空
         rsFilm.Filter = " 上次观看时间=" + txtQryTime  '按时间查询
    Else
         MsgBox "请输入查询内容!"
    End If
    If rsFilm.EOF = True Then
        MsgBox "找不到符合条件的影片!"
        rsFilm.Filter = adFilterNone        '取消过滤条件
        rsFilm.Resync                       '刷新记录集
    End If
    Exit Sub                '退出过程

ErrQuery:                   '设置错误处理标号
 MsgBox "输入有误!请重新输入!"
End Sub

Private Sub Form_Load()
    '下面的程序在窗体启动时将主窗体中的ADO数据控件所连接的记录集关联到
    '公用变量rsFilm，使得所有窗体都可调用同一记录集进行数据操作
    Set rsFilm = New ADODB.Recordset
    Set rsFilm = Adodc1.Recordset
End Sub
