Import External Data ... problem from Access Query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

For years I've used the "Import Data" function in Excel to present Access Query results. This has always been "bullet proof". The problem I seem to have lately is that some queries that are referenced in this way return ONLY Headings -- no data. In Access, the result of running the query look perfectly normal. Also, the problem isn't occuring with all queries -- yet I'm not seeing the common charactaristic of those that won't return data. There's no error message or other indication that there's been a problem -- just a result sheet with the headings of the query and no data. Some of the problem queries are a little complex (by the standard of queries I've had occasion to write) but don't seem outrageous. Also, they're not returning more than 500 - 600 rows of data MAX, so returned data volume wouldn't seem to be the problem

Any info or insight will be appreciated

Thanks

Sid
 
So, in summary:

- Previously: all queries returned a number of rows;
- Now: some queries return zero rows;

The problem will lie in the query's WHERE clause. For example, to
reproduce the effect, append this to a query's WHERE clause:

AND 0=1

In other words, you need to search you WHERE clause for something that
will compute to 'zero rows'.

--

Sid said:
For years I've used the "Import Data" function in Excel to present
Access Query results. This has always been "bullet proof". The
problem I seem to have lately is that some queries that are referenced
in this way return ONLY Headings -- no data. In Access, the result of
running the query look perfectly normal. Also, the problem isn't
occuring with all queries -- yet I'm not seeing the common
charactaristic of those that won't return data. There's no error
message or other indication that there's been a problem -- just a
result sheet with the headings of the query and no data. Some of the
problem queries are a little complex (by the standard of queries I've
had occasion to write) but don't seem outrageous. Also, they're not
returning more than 500 - 600 rows of data MAX, so returned data
volume wouldn't seem to be the problem.
 
Thanks for the time and suggestion. I've gone back and checked the queries I'm having trouble with. As I mentioned, when I run the query in Access, it returns just what I'm looking for. There aren't any "inputs" to the select statement other than from the database. Adding what you suggest to the query illustrates the issue you mentioned -- but the question remains why it would not then show up when referenced from Excel ..

Sid
 
Back
Top