Too few parameters error when Get External Access Data

A

aaronkuok

I use Excel as a front-end for an Access database.

I have tried running a manual Get External Data > New Database Query
and it seems to connect to the Access database fine because it list
the fields and lets me select them and so on, but when I click "Finish
to import the data it comes back with an error "Too few parameters
Expected 7."

My SQL statement doesn't use any parameter passing and it works fine i
Access. The SQL is as follow :

SELECT [rptFormat].[type], [rptFormat].[group], (IIF([res1].[GP_TTL]
0, [res1].[GP_TTL], 0)) AS [ttl]
FROM [rptFormat]
LEFT JOIN
(
(SELECT [em_mast].[type_code], [em_mast].[l2_code], count(*) A
[Gp_TTL]
FROM [em_mast]
WHERE (([em_mast].[L2_CODE]<>"X") AND ([em_mast].[COMPANY_CO]="ABC"
AND ([em_mast].[STAFF_STAT]="A"))
GROUP BY [em_mast].[type_code], [em_mast].[l2_code])
AS [res1] )
ON (([rptFormat].[type] = [res1].[type_code]) AN
([rptFormat].[group]=[res1].[l2_code] ))


Thanks for help
 
J

Jamie Collins

aaronkuok wrote ...
I use Excel as a front-end for an Access database.

I have tried running a manual Get External Data > New Database Query,
and it seems to connect to the Access database fine because it lists
the fields and lets me select them and so on, but when I click "Finish"
to import the data it comes back with an error "Too few parameters.
Expected 7."

Please post DDL (e..g CREATE TABLE em_mast ...) and test data (e.g.
INSERT INTO em_mast ...).

Jamie.

--
 
A

aaronkuok

Please log in yahoo (ID : ask_for_question, Password : nopassword) t
download the zip file for this problem.

This zip contains the original Access file - stafflist.mdb & a linke
dbf file em_mast.dbf that must test under the folder c:\ques.

You can test the query in the mdb called "ReportQuery" or "TypeGroup".
Both of them can be run in Access but when I use [Get External Data
function in Excel to link this query, the error "Too few parameters" i
displayed.

Thanks for help
 
Top