Import Data From Access to Excel

K

Kayda

Hi:

I want to import data into Excel 2003 from Access 2003. I have an
Access query that has 2 parameters and want to be able to pass those
parameters from Excel. However, I see no way to pass those parameters--
I choose Data | Import External Data | Import Data option and choose
an Access DSN. I run through the selections but there are no places to
enter my Access parameters and I get the usual "Too few parameters..."
error.

There is also the option of Data | Import External Data | New Database
Query, which I can build a query in Excel, and I can create parameters
there in Excel, but the problem is it seems I can only make parameters
from fields that are in the result set, and I the fields I want to
choose on are not in the result set, i.e. I want to choose Month and
Year but Month and Year aren't returned.

Also, how do I prevent the query from returning the field headers? I
have the field headers in my Excel spreadsheet anyway formatted nicely
and just want the data.

What is the best way to do this?

Thanks a lot,
Kayda
 
F

FSt1

hi,
the prompt for parameters must be on the excel side.
Click edit query in excel. with microsoft query comes up, click add criteria.
put the same parameters(criteria) in MSQ as is in the access query. then go
to the access query and remove all criteria(parameters).
run the MSQ. MSQ will prompt you for the parameters.
reason... the MSQ driver is no sophisticated enough to go to access, realize
than there are prompts for parameters, return to excel with the prompts for
parameters then take the parameter criteria back to access. that is why you
are getting the "to few parameters. expected 2" error. the MSQ driver
detected the prompt for parameters in the access query and errored out. with
MSQ, it sort of a 1 shot, 1 way deal so the prompt for parameter must be on
the excel side. MSQ can carry the prompts but can't "fetch" the prompts.

regards
FSt1
 

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