I am converting an old Access 2003 database to 2007. It has a query linking to a SQL database. How do I look at the link, e.g., whether it using a DSN, etc.?

The query has the globe to the left of it indicating it is linked. When I try to Open it, it says "ODBC - connection to '(a database name)' failed."

I have searched and seen many posts on Access tables linking to another database, but none of a query linking to another database.

link|improve this question
Check out Control Panel -> Setup data sources – Sathya May 21 '11 at 5:18
feedback

1 Answer

You can find the connect string of a table by typing this in the Immediate Windows in the VBE:

  ?CurrentDB.TableDefs("TableToCheck").Connect

That should get you started...

link|improve this answer
I need to see the connect information for a Query, not a Table. – Lars May 23 '11 at 18:08
Thanks. I just change TableDefs to QueryDefs and got the connection information I need. – Lars May 25 '11 at 16:37
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.