close

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
quot;too few parameters expectedquot;.

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

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
HISquot;lou sandersonquot; gt; wrote in message
...
gt; Microsoft Excel 2002 SP-2, Microsoft Windows XP professional
gt;
gt; I have my queries written in MS Access, and I pull the results into Excel
gt; via 'import external data'...'New database query'. My queries run fine in
gt; Access, and it works ok for most of the stuff I pull into Excel, but
gt; sometimes when I try to pull the results in Excel, I get an error that
gt; says
gt; quot;too few parameters expectedquot;.
gt;
gt; The error occurs at the very last step in the 'get external data'
gt; procedure,
gt; as Excel tries to connect to the datasource.
gt;
gt; This seems to occur most often when I have a union query somewhere in my
gt; Access query chain. This is extremely frustrating as I have to figure out
gt; ways to rewrite my queries without the union query.
gt;
gt; Has anyone seen anything like this before? Does anyone know why a union
gt; query in Access would cause such an error in Excel? Anyone know why Excel
gt; does this or maybe even how to fix it?
gt;
gt; Thanks,
gt; -Lou Sanderson

全站熱搜
創作者介紹
創作者 software 的頭像
software

software

software 發表在 痞客邦 留言(0) 人氣()