Office中国论坛/Access中国论坛

标题: ADP中能通过窗体添加OLE对象吗,如加入图片!!! [打印本页]

作者: XMX64311    时间: 2012-4-10 11:07
标题: ADP中能通过窗体添加OLE对象吗,如加入图片!!!
各位老师,ADP中能通过窗体添加OLE对象吗,如通过单击窗体中的按钮,然后找到图片并保存到数据库!
作者: zhuyiwen    时间: 2012-4-10 20:09
当然可以,与mdb操作一致
作者: XMX64311    时间: 2012-4-12 15:00
   temp = "Select * From [Warranty information]"
   RS.Open temp, CurrentProject.Connection, adOpenKeyset, adLockOptimistic
   RS.AddNew

RS("Claim NO") = Me![Text1]
RS("Service station") = Me![Text2]
RS("production date") = Me![Text3]
RS("engine NO") = Me![Text4]
RS("sale date") = Me![Text5]
RS("repair date") = Me![Text6]
RS("mileage") = Me![Text7]
RS("time in service") = Me![Text8]
RS("Customer complaint") = Me![Text9]
RS("Failure description") = Me![Text10]
RS("technical issue") = Me![Text11]
RS("root cause") = Me![Text12]
RS("Corrective Action") = Me![Text13]
RS("owner") = Me![Text14]
RS("Claim invoice NO") = Me![Text15]
RS("Claim invoice date") = Me![Text16]
RS("Claim Money") = Me![Text17]
RS("Customer") = Me![Combo1]
RS("Product Type") = Me![Combo2]
RS("Part NO") = Me![Combo3]
RS("Appearance problem") = Me![Combo4]
RS("Responsibility") = Me![Combo5]
RS("Link for Failure Mode illustration") = Me![OLE1]
RS("Link for Support Document") = Me![OLE2]
RS("input date") = Me![Text99]

RS.Update
RS.Close

其中的OLE1和OLE2中的对象,我是怎么也保存不到数据库中!
作者: XMX64311    时间: 2012-4-12 15:02
老师在线吗?
作者: XMX64311    时间: 2012-4-12 15:35
[[attach]48977[/attach]
作者: XMX64311    时间: 2012-4-12 15:36
本帖最后由 XMX64311 于 2012-4-12 15:37 编辑

运行时错误提示如上图所示!
作者: zhuyiwen    时间: 2012-4-13 18:15
XMX64311 发表于 2012-4-12 15:00
temp = "Select * From [Warranty information]"
   RS.Open temp, CurrentProject.Connection, adOpen ...


这样做当然行不通。

难道你在mdb中这样通得过?


你直接绑定窗体记录源呀,那样才能 Link 图片。
  1. Me.RecordSource = "Select * From [Warranty information]"
复制代码
不用辛苦去写这样一大堆的代码。




欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) Powered by Discuz! X3.3