too few parameters

G

Guest

Microsoft Excel 2002 SP-2, Microsoft Windows XP professional

I have my queries written in MS Access, and I pull the results into Excel
via 'import external data'...'New database query'. My queries run fine in
Access, and it works ok for most of the stuff I pull into Excel, but
sometimes when I try to pull the results in Excel, I get an error that says
"too few parameters expected".

The error occurs at the very last step in the 'get external data' procedure,
as Excel tries to connect to the datasource.

This seems to occur most often when I have a union query somewhere in my
Access query chain. This is extremely frustrating as I have to figure out
ways to rewrite my queries without the union query.

Has anyone seen anything like this before? Does anyone know why a union
query in Access would cause such an error in Excel? Anyone know why Excel
does this or maybe even how to fix it?

Thanks,
-Lou Sanderson
 
N

Nick Hodge

Lou

Parameter queries are also a problem to the ODBC drivers using MSQuery. You
will get the too few parameters, expected 1 error if your parameter is in
Access. Not sure about Union queries, but I overcome this by pasting the
SQL from access into MSQuery, that seems to fix it.

In other words, get a simple select query in Access and adapt this in
MSQuery. Using ODBC this is your only route. If you use another datasource
type (OLE DB or ADO.Net) then you may be able to, but that's another
question

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
www.nickhodge.co.uk
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top