Solved

Access Database As Linked Server?

Posted on 2013-02-01
6
454 Views
Last Modified: 2013-02-01
I'm running SQL Server 2008 SP2
(No idea what version of Access wrote the mdb file, but should be either 2008 or the version just prior)

I have an mdb file (historic data) that I need to read.  Rather than go out and purchase MS Access, I'd like it if I can connect it to SQL Server as a Linked Server.

I used the following code:
EXEC sp_addlinkedserver 
   @server = 'access_test', 
   @provider = 'Microsoft.Jet.OLEDB.4.0', 
   @srvproduct = 'OLE DB Provider for Jet',
   @datasrc =  'C:\Users\Public\Documents\xxxxxx.mdb'
GO

Open in new window

Which seemed to connect to the file with no issue.  However when I click on the folder that should display the files, I get the following error:
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. (Microsoft SQL Server, Error: 7308)

Any ideas?

How do I connect an MS Access database to SQL Server as a Linked Server?
0
Comment
Question by:Clif
6 Comments
 
LVL 23

Expert Comment

by:Ioannis Paraskevopoulos
ID: 38844193
Hi,

Try this:

sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'Ad Hoc Distributed Queries', 1;
GO
RECONFIGURE;
GO

Open in new window


and have a look at http://blog.sqlauthority.com/2010/11/03/sql-server-fix-error-ms-jet-oledb-4-0-cannot-be-used-for-distributed-queries-because-the-provider-is-used-to-run-in-apartment-mode/

Giannis
0
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 500 total points
ID: 38844204
You should be able to do this with the SQL Server Migration Assistant
0
 
LVL 84
ID: 38844222
If you just want to review the data you can use the free Access Runtime:

http://www.microsoft.com/en-us/download/details.aspx?id=10910

Install that on a workstation, then locate the .mdb file and doubleclick it. The runtime should open and allow you to review the data in the tables.

of course, if you need to move data into your server database, then you can do as suggested above, or use SSIS to move the data in.
0
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 10

Author Comment

by:Clif
ID: 38844231
jyparask,
I ran across that page myself and tried the recommendation.  It did not work.

Unless, of course, I'm supposed to remove the (failed) link, then run the configuration, then re-attach the Access database.

-----
fyed,
SSMA sounds promising, however I cannot seem to find a download link.  Searching around from the link you provided, I found what looked like a download link, but was lead to a Microsoft page called "Learning Center" and a suggestion that I "Get SQL Server 2012".
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 38844253
Try this link.  Most of the links I had were redirected, but finally found this:

http://www.microsoft.com/en-us/download/details.aspx?id=28763
0
 
LVL 10

Author Closing Comment

by:Clif
ID: 38844791
That is perfect.  It's exactly what I needed.

Thanks.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now