【问题标题】:Cannot join on Memo, OLE, or Hyperlink Object - Access 2007 - outer joins无法加入备注、OLE 或超链接对象 - Access 2007 - 外部联接
【发布时间】:2012-12-08 11:12:16
【问题描述】:

我在 Access 2007 中有 2 个这样的表...

 Table 1 - tbEmployees Details
           FieldName      Data Type
      PK   *ID            Autonumber 
           EmployeeID     Number
           First          Text
           ....           ...

 Table 2 - tbEmployeesQualification
           FieldName    Data Type
     PK   *ID           Autonumber  
           CV (attachment)  Attachment  
           Qualification / Certificate (memo box)
           Skills (memo box)

我正处于关系的设计阶段。我正在尝试使用上表中的外部联接,因为我想为每个员工附加简历。我尝试了以下方法。 将 ID 从 tbEmployees Details 拖到 tbEmployeesQualification 上。然后出现 Join Properties 屏幕...

   Left Table  -            Right Table -
   tbEmployees Details      tbEmployeesQualification 
   Left Column -            Right Column 
   ID                       Qualification / Certificate

我选择了选项 2 - 包括来自 .... 的所有记录,其中连接字段相等。

为了测试这一点,我使用了 Query。当我使用查询向导时,似乎查询显示的结果包括来自 tbEmployees Details 的所有数据和所有数据 tbEmployeesQualification BUT

当我使用查询设计时,我收到以下错误...

Cannot join on Memo, OLE, or Hyperlink Object ([tbEmployees Details].ID=[     
tbEmployeesQualification].[Qualification/Certificate])

错误是正确的。我知道 ID 具有 Autonumber 作为数据类型和来自 tbEmployeesQualification 的资格/证书作为备忘录数据类型,因此不能使用内部联接。所以我的问题是如何解决这个问题?还是可以通过使用外部连接来解决,还是我需要做一些我没见过的事情?

提前感谢您抽出时间回答我的问题。

编辑 - 我认为外键也许是答案。我刚刚在 tbEmployeesQualification 中添加了数据类型为 Number 的 ID。创建一对多关系,一个是 tbEmployees Details,许多是 tbEmployeesQualification。我会尽快更新。

【问题讨论】:

  • 我认为您需要重新设计您的架构。您的 tbEmployeesQualification 表应包含一个名为 EmplID 的列,该列与 tbEmployee 表的 ID 链接。加入表格时使用“ON tbEmployee.ID = tbEmployeesQualification.EmplID”条件
  • 如何结束这个问题?

标签: sql database join outer-join


【解决方案1】:

通过使用一对多关系解决了这个问题。在 tbEmployees 表中,我将名字放在字段名称 (PK) 中,数据类型为文本。在 tbEmployeesQualification 表中,我再次使用数据类型 Text 创建了 Field Name FirstName。我将 tbEmployees 表(一个)链接到 tbEmployeesQualification 表(很多)。这解决了问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-11-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-09
    • 2019-07-12
    • 1970-01-01
    相关资源
    最近更新 更多