title: Access SQL Query from another DB
body: <p>I want to apply an SQL query to one Access table, from which it is retrieving data from a table in another Access file. I've looked around on this subject and can't seem to get solutions to work.</p>
  
  <p>Based on this source <a href="http://support.microsoft.com/kb/113701" rel="nofollow">http://support.microsoft.com/kb/113701</a>, I came up with the following, but still have no luck.</p>
  
  <pre><code>sSQL = "UPDATE TableInCurrentDB 
  SET [Field1InCurrentDB]= DAvg('Field1InExternalDB','[;database=C:\VB\ExternalDB.accdb].[TableInExternalDB]','Field2InExternalDB= &amp; Year(Now()) &amp; ') 
  WHERE [Field2InCurrentDB]='1';"
  DoCmd.RunSQL sSQL
  </code></pre>
  
  <p>I know that the error lies somewhere in the reference to the external DB, because the code works fine if the tables are in the same database. However, it's tough to tell exactly what's wrong because the error I get is 'Unknown'.</p>
  
  <p>How can I modify this statement to update an Access table from another Access database's table?</p>