下面这些是保存视频文件到数据库的代码
但是我想好久都不知道怎么读取并播放
因为播放视频的控件没有DataSource和DataField属于
请大神教教我
Public tp As String
Private Sub Command1_Click()
'浏览文件
Dim str '定义变量
CommonDialog1.Filter = "*.MP4|*.MP4|*.GIF|*.GIF"
CommonDialog1.ShowOpen
If CommonDialog1.FileName <> "" Then
tp = CommonDialog1.FileName
CommonDialog1.FileName = ""
Else
CommonDialog1.FileName = ""
End If
End Sub
Private Sub Command2_Click()
sjkdz = App.Path & "\wj\sjk.mdb"
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & sjkdz & " Adodc1.RecordSource = "select * from sp "
Adodc1.Refresh
Adodc1.Recordset.AddNew '添加一个纪录
Adodc1.Recordset.Fields("视频名") = spm
Adodc1.Recordset.Update '储存赋值的新纪录
Adodc1.Recordset.Close
Adodc1.RecordSource = "select * from sp where 视频名='" & spm & "'"
Adodc1.Refresh
mst.Type = adTypeBinary
mst.Open
If tp <> "" Then mst.LoadFromFile tp
Adodc1.Recordset.Fields("视频") = mst.Read
Adodc1.Recordset.Update
Adodc1.Refresh
mst.Close
End Sub
但是我想好久都不知道怎么读取并播放
因为播放视频的控件没有DataSource和DataField属于
请大神教教我
Public tp As String
Private Sub Command1_Click()
'浏览文件
Dim str '定义变量
CommonDialog1.Filter = "*.MP4|*.MP4|*.GIF|*.GIF"
CommonDialog1.ShowOpen
If CommonDialog1.FileName <> "" Then
tp = CommonDialog1.FileName
CommonDialog1.FileName = ""
Else
CommonDialog1.FileName = ""
End If
End Sub
Private Sub Command2_Click()
sjkdz = App.Path & "\wj\sjk.mdb"
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & sjkdz & " Adodc1.RecordSource = "select * from sp "
Adodc1.Refresh
Adodc1.Recordset.AddNew '添加一个纪录
Adodc1.Recordset.Fields("视频名") = spm
Adodc1.Recordset.Update '储存赋值的新纪录
Adodc1.Recordset.Close
Adodc1.RecordSource = "select * from sp where 视频名='" & spm & "'"
Adodc1.Refresh
mst.Type = adTypeBinary
mst.Open
If tp <> "" Then mst.LoadFromFile tp
Adodc1.Recordset.Fields("视频") = mst.Read
Adodc1.Recordset.Update
Adodc1.Refresh
mst.Close
End Sub