Access开发培训
网站公告
·Access专家课堂QQ群号:151711184    ·Access快速开发平台下载地址及教程    ·欢迎加入Access专家课堂微信群!    ·如何快速搜索本站文章|示例|资料    
您的位置: 首页 > 技术文章 > Access2007

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

时 间:2011-08-01 00:21:42
作 者:Aaron   ID:20267  城市:闵行
摘 要:在表的附件字段之间传递图片 
正 文:

在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群 (群号:54525238)       Access源码网店

常见问答:

技术分类:

相关资源:

专栏作家

关于我们 | 服务条款 | 在线投稿 | 友情链接 | 网站统计 | 网站帮助