Solved

Access Database As Linked Server?

Posted on 2013-02-01
6
478 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

778 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