If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Link to MS Access Query Problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
Join Date: Feb 2012
Posts: 9
Question Link to MS Access Query Problem

So I'm trying to set up a link in Excel 2007 to a query in a Access 2007 database but the result I get are the headers and 2 blank rows. When I check the query in Access, it comes through fine. Whats wrong? How do I fix the link?
Reply With Quote
  #2 (permalink)  
Old
Registered User
 
Join Date: Apr 2004
Location: Derbyshire, UK
Posts: 749
Hi

I think a little more info is required, ie. what are you trying to achieve and what are you doing now that dosn't work?

MTB
Reply With Quote
  #3 (permalink)  
Old
Registered User
 
Join Date: Feb 2012
Posts: 9
I have a query that I've created in Access. Results are perfect. When I go to Excel and try to create a link to that query, none of the results show in Excel. I only get the header row and 2 blank rows. I can export the query to an Excel sheet, but I want the convenience of the refresh option.
Reply With Quote
  #4 (permalink)  
Old
Registered User
 
Join Date: Apr 2004
Location: Derbyshire, UK
Posts: 749
Yes that's fine, but how are you attempting to make the link?

For instance, are you using VBA: if so could you post the code?
In addition you could also post the SQL string of the query that woork in Access.

MTB
Reply With Quote
  #5 (permalink)  
Old
Registered User
 
Join Date: Feb 2012
Posts: 9
No, i'm just using the wizard. Data ribbon, Get External Data, From Access, browsing for my database and selecting the query I want to link.
Reply With Quote
  #6 (permalink)  
Old
Registered User
 
Join Date: Feb 2012
Posts: 9
The only thing that I can think of is that the query is pretty complex (many joins, many iif statements) that it times out after a certain amount of time. does this sound logical?
Reply With Quote
  #7 (permalink)  
Old
Registered User
 
Join Date: Dec 2012
Posts: 1
RE: Link to MS Access Query Problem

I had the same problem as MikeTheBike. I set up a query in MS Access and then used the Data Wizard in Excel (go to Data -> Get External Data -> From Access) to import the data from Access, and I got two blank rows. When I refreshed that table, I got one blank row. I was able to import other queries, and I double checked to make sure that running this query in Access give me a non-null result.

To fix this (and I don't know why this works, just that it did in this instance) I used "From Other Sources" instead of "From Access" in the data import, and used "From Microsoft Query". A small window pops up to allow you to pick an Access Database and then a query or a table within the database. And this worked.

Again, I'm not sure why this worked, only that it did, so if there's an Excel-Access expert out there that can shed some light on this, I'd be grateful.
Reply With Quote
  #8 (permalink)  
Old
Registered User
 
Join Date: Sep 2013
Posts: 7
I have same issue but in 2010. I can get the table to import fine but the query returns headers and 2 blank rows.

I tried the 'from other sources' method suggested above but when I browse to select my data source the folder containing my Access Database is blank (no items match your search).

My query isn't even complex, it just shows all rows from the main table that have data in one particular field (i.e gets rid of rows that have a blank in that field).
Reply With Quote
Reply

Tags
access excel link query

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On