【Access示例】使用Web控件显示GIF动画-will.miao
Access软件网QQ交流学习群(群号码198465573),欢迎您的加入!
首页 >技术文章> Access数据库-窗体/数据页


【Access示例】使用Web控件显示GIF动画

发表时间:2016/4/22 8:19:17 评论(2) 浏览(6056)  评论 | 加入收藏 | 复制
   
摘 要:利用Microsoft Web Browser控件显示gif动画。
正 文:

主要的代码:

Private Sub Form_Open(Cancel As Integer)

  On Error Resume Next
  
  Call BinExport

  Me.GRBrowser.Navigate strPfadDB() & "gr.html"

End Sub


Private Function BinExport()

Dim DB As Database, rs As Recordset, FrNum As Long, BinData() As Byte

Set DB = CurrentDb
Set rs = DB.OpenRecordset("select * from tblJagd order by namen", dbOpenSnapshot)

rs.MoveFirst

For I = 1 To 4

  FrNum = FreeFile
  If I = 1 Then Open strPfadDB() & "gr.html" For Binary As #FrNum
  If I = 2 Then Open strPfadDB() & "hor2.gif" For Binary As #FrNum
  If I = 3 Then Open strPfadDB() & "wolf.gif" For Binary As #FrNum
  If I = 4 Then Open strPfadDB() & "hunde.gif" For Binary As #FrNum
  
    ReDim BinData(rs("objekt").FieldSize)
     
    BinData() = rs("objekt").GetChunk(0, rs("objekt").FieldSize)
    Put #FrNum, , BinData()
    
  Close #FrNum
   
  Erase BinData
  
  rs.MoveNext
  
 Next
 
  rs.Close
  DB.Close
  Set rs = Nothing
  Set DB = Nothing

End Function


Private Function strPfadDB() As String

  Dim strName As String, Z As Byte
  
  strName = CurrentDb.Name
  
  For Z = 1 To Len(strName)
    If Mid(strName, Z, 1) = "\" Then Q = Z
  Next

  strPfadDB = Left(strName, Q)
  

End Function


附   件

点击附件下载

 

演   示:


Access软件网交流QQ群(群号:198465573)
 
 相关文章
窗体插入GIF图片  【彭海涛  2009/10/29】
Gif动画控件与示例  【程绍权  2010/2/1】
GIF动画录制器,屏幕录制动画效果工具  【麥田  2011/10/4】
access中除第三方控件外播放GIF的三种方法  【叶海峰  2012/2/6】
在Access窗体中播放动态Gif  【纵云梯  2013/6/27】
常见问答
技术分类
相关资源
文章搜索
关于作者

will.miao

文章分类

文章存档

友情链接