为什么Excel VBA无法使用@符号查询表格?

我试图查询一个表,称之为history @ integration。

当我查询表,这种types的查询:

select * from history@integration where id=5 

并获得预期的产出。

用excel我以这种方式连接到数据库:

 cn.Open ( _ "User ID=" & userID & _ ";Password=" & password & _ ";Data Source=" & datasource & _ ";Provider=MSDAORA.1") 

但是我得到的data type is not supported的运行时错误data type is not supported 。 我已经validation使用完全相同的连接,我可以查询数据库与其他“标准”表,如select * from history 。 任何关于如何获得“正确”types的想法。

在Oracle中(假设这是你正在使用的,并且在你的问题中陈述是有帮助的)@通常用于表示数据库链接:可能它不是表名的一部分,但是表“history”是实际上是通过名为“集成”的数据库链接链接到不同的数据库。

并非所有数据types都可以通过Oracle数据库链接进行select(例如,LOBtypes)

@是SQL中的保留字符。 尝试围绕表格名称,括号如: [history@integration]