在表的附件字段之间传递图片 -Aaron
Access软件网QQ交流学习群(群号码198465573),欢迎您的加入!
首页 >技术文章> Access2007


在表的附件字段之间传递图片

发表时间:2011/8/1 0:21:42 评论(0) 浏览(9381)  评论 | 加入收藏 | 复制
   
摘 要:在表的附件字段之间传递图片 
正 文:

在2007中如果,想在两个表的附件之间传递文件,可以用如下的语句:

                '用变量来保存图片的话,就会出错
                With rstBIPO
                    With .Fields("bipoimage").Value
                        If Dir(strPicPath) <> "" Then
                            Kill strPicPath
                        End If
                        .Fields("filedata").SaveToFile (strPicPath)
                        If .RecordCount > 0 Then
                            .MoveFirst
                            Do Until .EOF
                                .Delete
                                .MoveNext
                            Loop
                        End If
                    End With
                End With
                With rstPart
                    .Edit
                    Set rstPic = .Fields("partimage").Value
                    With rstPic
                        If .RecordCount > 0 Then
                            .MoveFirst
                            Do Until .EOF
                                .Delete
                                .MoveNext
                            Loop
                        End If
                        If Dir(strPicPath) <> "" Then
                            .AddNew
                            .Fields("filedata").LoadFromFile strPicPath
                            .Update
                            Kill strPicPath
                        End If
                    End With
                    .Update
                    .Close
                End With
                Set rstPart = Nothing
            End If


Access软件网交流QQ群(群号:198465573)
 
 相关文章
access开发平台--上传下载/添加附件的示例  【风行  2012/4/19】
【access源码示例】上传图片或附件到指定文件夹或共享文件夹的通...  【金宇  2012/6/1】
【Access源码示例】同一个产品上传多个附件示例  【金宇  2012/7/9】
VBA http post 上传 multipart/form-d...  【dbaseIIIer  2012/12/15】
常见问答
技术分类
相关资源
文章搜索
关于作者

Aaron

文章分类

文章存档

友情链接