0
我正在嘗試使用JET連接查詢Excel工作簿中的幾個命名範圍,並且收到錯誤(運行時錯誤'-2147217900(80040e14)':連接表達式不是支持)當我嘗試添加第二個條件的加入一個:錯誤:「不支持連接表達式」
Dim strQuery As String
strQuery = "SELECT mrx.Underlying "
strQuery = strQuery & ",mrx.[exp] "
strQuery = strQuery & ",sum(mrx.[codc]) "
strQuery = strQuery & ",max(mapDt.[Str]) "
strQuery = strQuery & "FROM ((([dataMRX] AS mrx "
strQuery = strQuery & "LEFT OUTER JOIN [mapDt] AS mapDt on "
strQuery = strQuery & "(mrx.[exp] = mapDt.[DtNumeric])) "
strQuery = strQuery & "LEFT OUTER JOIN [mapUdl] AS mapUdl on "
strQuery = strQuery & "(mrx.[Underlying] = mapUdl.[rmpUdl])) "
strQuery = strQuery & "LEFT OUTER JOIN [dataTtm] AS ttm on "
strQuery = strQuery & "(ttm.[Underlying] = mapUdl.[ttmUdl] "
strQuery = strQuery & "AND ttm.[End Month] = mapDt.[Dt])) "
strQuery = strQuery & "GROUP BY mrx.Underlying, mrx.[exp] "
strQuery = strQuery & "ORDER BY mrx.Underlying DESC "
特別是,如果我刪除第一或第二,在過去左外連接條件(ttm.[Underlying] = mapUdl.[ttmUdl]
或tmm.[End Month] = mapDt.[Dt])
的查詢工作正常。但是,在這兩種情況下,我都會遇到錯誤。
我使用JET 4.0:
strCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strFile _
& ";Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1"";"
嘗試從「FROM」之前刪除括號中的一個,並從語句結尾刪除一個括號。 – Gareth
thx爲響應,看起來像我得到了相同的連接錯誤 – ignorantcity