title: SQL to Access linked server
body: <p>I am trying to add a linked server to a Access database.  I am using the following SQL code to do this.</p>
  
  <pre><code>exec sp_addlinkedserver 
  @server = 'Test',
  @provider = 'Microsoft.Jet.OLEDB.4.0',
  @srvproduct = 'OLE DB Provider for Jet',
  @datasrc = '\\srv\public$\CM Database\Data\sysConfig_dat.mdb'
  go
  EXEC sp_addlinkedsrvlogin Test, FALSE, Null, Admin, Null
  </code></pre>
  
  <p>but when i run this...</p>
  
  <pre><code>select * from Test...tblProduct
  </code></pre>
  
  <p>i get this error...</p>
  
  <blockquote>
    <p>OLE DB provider
    'Microsoft.Jet.OLEDB.4.0' cannot be
    used for distributed queries because
    the provider is configured to run in
    single-threaded apartment mode. what
    am i doing wrong?</p>
  </blockquote>
  
  <p>I am using SQL Server Management Studio 2008 on a 32 bit system.</p>