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

📄 vcdedit.frm

📁 原创VB+SQL影音租赁系统 醮简单 具体看里边的文本文档
💻 FRM
📖 第 1 页 / 共 2 页
字号:
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF0000&
      Height          =   285
      Left            =   7680
      TabIndex        =   30
      Top             =   2400
      Width           =   570
   End
   Begin VB.Label Label7 
      AutoSize        =   -1  'True
      BackColor       =   &H00FFC0FF&
      Caption         =   "情节概述"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF0000&
      Height          =   285
      Left            =   600
      TabIndex        =   29
      Top             =   4560
      Width           =   1140
   End
   Begin VB.Label Label9 
      AutoSize        =   -1  'True
      BackColor       =   &H00FFC0FF&
      Caption         =   "影片修改"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   21.75
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000080FF&
      Height          =   435
      Left            =   4320
      TabIndex        =   28
      Top             =   360
      Width           =   1815
   End
   Begin VB.Label Label10 
      AutoSize        =   -1  'True
      BackColor       =   &H00FFC0FF&
      Caption         =   "剧照路径"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF0000&
      Height          =   285
      Left            =   4800
      TabIndex        =   27
      Top             =   3000
      Width           =   1140
   End
   Begin VB.Label Lyear 
      AutoSize        =   -1  'True
      BackColor       =   &H00FFC0FF&
      Caption         =   "年"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF0000&
      Height          =   285
      Left            =   2760
      TabIndex        =   26
      Top             =   3960
      Width           =   285
   End
   Begin VB.Label Lmonth 
      AutoSize        =   -1  'True
      BackColor       =   &H00FFC0FF&
      Caption         =   "月"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF0000&
      Height          =   285
      Left            =   3720
      TabIndex        =   25
      Top             =   3960
      Width           =   285
   End
   Begin VB.Label Ldate 
      AutoSize        =   -1  'True
      BackColor       =   &H00FFC0FF&
      Caption         =   "日"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF0000&
      Height          =   285
      Left            =   4680
      TabIndex        =   24
      Top             =   3960
      Width           =   285
   End
   Begin VB.Label Label12 
      AutoSize        =   -1  'True
      BackColor       =   &H00FFC0FF&
      Caption         =   "小时"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF0000&
      Height          =   210
      Left            =   6840
      TabIndex        =   23
      Top             =   2520
      Width           =   420
   End
   Begin VB.Label Label13 
      AutoSize        =   -1  'True
      BackColor       =   &H00FFC0FF&
      Caption         =   "ID"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF0000&
      Height          =   285
      Left            =   5160
      TabIndex        =   22
      Top             =   1200
      Width           =   300
   End
   Begin VB.Label Label14 
      AutoSize        =   -1  'True
      BackColor       =   &H00FFC0FF&
      Caption         =   "租金"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF0000&
      Height          =   285
      Left            =   5040
      TabIndex        =   21
      Top             =   1800
      Width           =   570
   End
   Begin VB.Label Lid 
      AutoSize        =   -1  'True
      BackColor       =   &H00FFC0FF&
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000C000&
      Height          =   285
      Left            =   6240
      TabIndex        =   20
      Top             =   1200
      Width           =   735
   End
   Begin VB.Label Label15 
      AutoSize        =   -1  'True
      BackColor       =   &H00FFC0FF&
      Caption         =   "元/天"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF0000&
      Height          =   210
      Left            =   6840
      TabIndex        =   19
      Top             =   1920
      Width           =   525
   End
End
Attribute VB_Name = "VCDEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rst As Recordset
Dim com As Command
Dim tablename, tbname, tbnameEN, tpublishdate, id, picturepath As String

Private Sub CanncelBt_Click()
'rst.CancelUpdate
Unload Me
End Sub

Private Sub ClearBT_Click()
For Each Control In VCDEdit
    If TypeOf Control Is TextBox Then
       Control.Text = ""
    End If
Next

End Sub

Public Sub Form_Load()
Set rst = New Recordset
Set com = New Command
id = "00" & VCDView.idTRS
'MsgBox id
For d = 1 To 31
Cday.AddItem (d)
Next d
'Cday.ListIndex = 0
For m = 1 To 12
Cmonth.AddItem (m)
Next m
'Cmonth.ListIndex = 0

For y = 2003 To 1930 Step -1
Cyear.AddItem (y)
Next y
'Cyear.Text = 2003
tablename = VCDView.TableNameTRS

'MsgBox tablename
Select Case tablename
       Case "爱情"
           tbnameEN = "love"
       Case "喜剧"
          tbnameEN = "comedy"
       Case "卡通"
          tbnameEN = "cartoon"
       Case "科幻"
          tbnameEN = "science"
       Case "冒险"
          tbnameEN = "venture"
       Case "动作"
          tbnameEN = "action"
       Case "艺术"
          tbnameEN = "art"
       Case "战争"
          tbnameEN = "war"
       Case "广告"
          tbnameEN = "advertisement"
       Case "恐怖"
          tbnameEN = "terror"
End Select
'MsgBox tbnameEN
'MsgBox id
'com.ActiveConnection = con
rst.Open "select * from " & tbnameEN & " where cid = '" & Trim(id) & " '", con, adOpenDynamic, adLockBatchOptimistic
picturepath = Trim(rst!cpicpath)
If rst.EOF = True Then
   MsgBox "没有此影片的信息!"
   rst.Close
Else
   Call DataView
   rst.Close
   'id = ""
   'tbnameEN = ""
End If
End Sub

Private Sub Dir1_Change()
On Error GoTo dirhandler
File1.Path = Dir1.Path
Exit Sub
dirhandler:
     Dir1.Path = Files.Path
End Sub

Private Sub Drive1_Change()
On Error GoTo drivehandler
    Dir1.Path = Drive1.Drive
Exit Sub
drivehandler:
    Drive1.Drive = Dir1.Path
End Sub

Private Sub File1_Click()
SelectedFile = File1.Path & "\" & File1.FileName
On Error GoTo picerr
Image1.Picture = LoadPicture(SelectedFile)
picturepath = SelectedFile
MsgBox picturepath
Exit Sub
picerr:
MsgBox "此文件不是图片文件!无法显示!请重新选择!"
End Sub

Private Sub Form_Unload(Cancel As Integer)
'rst.Open
'rst.Close
'tbnameEN = ""
'id = ""
End Sub

Private Sub OKBT_Click()
MsgBox picturepath
intstatus = 1
For Each Control In VCDEdit
    If TypeOf Control Is TextBox Then
       If Control.Text = "" Then
          MsgBox "请输入完整的影片信息!"
          intstatus = 0
          Exit For
       End If
    End If
Next
If Asc(Trim(Tprice.Text)) > 57 Or Asc(Trim(Tprice.Text)) < 48 Then
   MsgBox "价格应输入数字!请注意!"
   Tprice.SetFocus
   Exit Sub
ElseIf Asc(Trim(Tlength.Text)) > 57 Or Asc(Trim(Tlength.Text)) < 48 Then
   MsgBox "长度应输入数字!请注意!"
   Tlength.SetFocus
   Exit Sub
ElseIf Asc(Trim(Tstock.Text)) > 57 Or Asc(Trim(Tstock.Text)) < 48 Then
   MsgBox "库存应输入数字!请确认!"
   Tstock.SetFocus
   Exit Sub
End If
If intstatus = 1 Then
    Dim nid, name, language, lenth, publishdate, price, parts, director, picpath, stock, story, level As String
    'nid = Lid.Caption
    name = Tname.Text
    language = Tlanguage.Text
    lenth = Tlength.Text
    publishdate = Cyear & "-" & Cmonth & "-" & Cday
    price = Tprice.Text
    parts = Tparts.Text
    director = Tdirector.Text
    story = Tstory.Text
    'picpath = picturepath
    stock = Tstock.Text
    level = ComboLevel.Text
    
    MsgBox tbnameEN
    MsgBox publishdate
    rst.Open "update " & tbnameEN & " set cname = '" & name & "',clanguage='" & language & "',ilenth= " & _
    lenth & " ,dpublishdate=" & publishdate & " ,mPrice=" & price & " ,cparts='" & parts & "',cdirector='" & director & "', cstory='" & _
    story & "',cpicpath='" & picturepath & "',clevel='" & level & "',istock=" & stock & " where cid='" & id & "'", con, adOpenDynamic, adLockOptimistic
    
    MsgBox "记录修改成功! :)"
    'Dim a As Integer
    '    a = MsgBox("继续添加影片信息吗?", vbYesNo, "提示!:)")
    'If a = 6 Then
    '    VCDAdd.Visible = True
    'Else
    'rst.Close
    Unload Me
    'VCDEdit.Visible = False
    tbname = ""
    'Exit Sub
    'End If
    'rst.Close
    'autoid
End If
'For Each Control In VCDedit
'    If TypeOf Control Is TextBox Then
'       Control.Text = ""
'    End If
'Next
End Sub

Public Function DataView()
If rst.EOF = True Then
   MsgBox "数据表为空!"
Else
    Lid.Caption = rst!cid
    Tname.Text = rst!cname
    Tparts.Text = rst!cparts
    Tdirector.Text = rst!cdirector
    Tstock.Text = rst!istock
    tpublishdate = rst!dpublishdate
     Cyear.Text = DatePart("y", tpublishdate)
     Cmonth.Text = DatePart("m", tpublishdate)
     Cday.Text = DatePart("d", tpublishdate)
    Tprice.Text = rst!mPrice
    Tlanguage.Text = rst!clanguage
    Tlength.Text = rst!ilenth
    Tstory.Text = rst!cstory
    ComboLevel.Text = rst!clevel
    ComboType.Text = tablename
    'Tpicpath.Text = rst!cpicpath
    On Error GoTo picerr
    Image1.Picture = LoadPicture(rst!cpicpath)
    'For t = 0 To Len(picturepath)
        'd=
    'Drive1.Drive = picturepath
End If
Exit Function
picerr:
Image1.Picture = LoadPicture("h:\pictures\egg.jpg")
End Function

Public Function gettbname(name As String)
tbname = name
End Function

⌨️ 快捷键说明

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