0

Trying to access certain tables/views using Excel causes the executing program, "Microsoft Query", to crash. "Ordinary" tables with only one primary key can be found and exported without any problems.

The table that can't be imported contains two columns which both are primary key and both are foreign keys. One of the views consists of a pair of inner joins and the other view is a grouped table (SUM() and GROUP BY). The table and these two views seem to crash the "Microsoft Query". Any idea of how to solve this?

EDIT: The table looks somewhat like this:

CREATE TABLE AccountHolder
(
  Account BIGINT(10),
  Customer INT,
  PRIMARY KEY(Account, Customer),
  CONSTRAINT FKAccountHolderAccount
    FOREIGN KEY AccountHolder (Account)
    REFERENCES Account (AccountNumber),
  CONSTRAINT FKAccountHolderCustomer
    FOREIGN KEY AccountHolder (Customer)
    REFERENCES Customer (ID)
) ENGINE = InnoDB;
4

1 回答 1

1

我有类似的问题。当我单击表名前的减号时,Microsoft Query 立即崩溃。

我进行了一些测试,经过反复试验,问题之一似乎是表名的长度。超过 18 个字符的表名导致 Microsoft Query 崩溃。

解决方法是创建一个名称包含 18 个字符或更少字符的视图。我再次尝试并能够查看表格列,选择它们并将它们导入 Excel。

我仔细检查了一个名称为 18 个或更少字符、包含 3M 条记录并组成 147 列的巨大表,并尝试检索数据。我能够选择所有列并设置一些条件,但 Microsoft Query 再次崩溃。我当时想也许列名应该遵守相同的规则,但事实并非如此。

我用相同的列名在有问题的表上创建了另一个视图,并尝试检索完全相同的记录并且它有效......我很困惑,但至少它有效。

希望这会在某种程度上有所帮助。

于 2012-06-29T15:46:02.057 回答