[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How to create a SQL Server Linked Server to MS Access

Posted on 2012-04-02
5
Medium Priority
?
427 Views
Last Modified: 2012-06-27
I need to create a linked server in SQL Server 2008 R2 to a MS Access 2007 database.

Does anyone have any tips?

Thanks,
Steve
0
Comment
Question by:fcsIT
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 15

Assisted Solution

by:Deepak Chauhan
Deepak Chauhan earned 1000 total points
ID: 37798559
There is two  blck of script both are working fine u can opt whatever is usable for you

1.
USE [master]
GO
EXEC master.dbo.sp_addlinkedserver @server = N'ACCESS', @srvproduct=N'access', @provider=N'Microsoft.ACE.OLEDB.12.0', @datasrc=N'f:\test.accdb'
GO
 
EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname = N'ACCESS', @locallogin = NULL , @useself = N'False'
GO

or you can use below template  only put you actual variables it is tested and working fine..

2.
EXEC sp_addlinkedserver
    @server = N'Your Linked Server Name',
    @provider = N'Microsoft.ACE.OLEDB.12.0',
    @srvproduct = N'Access2007',
    @datasrc = N'C:\path\to\your\db.accdb'
GO

-- Set up login mapping using current user's security context
EXEC sp_addlinkedsrvlogin
    @rmtsrvname = N'Your Linked Server Name',
    @useself = N'TRUE',
    @locallogin = NULL,
    @rmtuser = N'Your Linked Server Name',
    @rmtpassword = ''
GO

-- List the tables on the linked server
EXEC sp_tables_ex N'Your Linked Server Name'
GO

-- Select all the rows from table1
SELECT * FROM [Your Linked Server Name]...table1
0
 

Author Comment

by:fcsIT
ID: 37798565
Quick question that I forgot to include in my original post, the Access database is supplied by a third party vendor.  The credentials for accessing it do not include a username, but does have a password.

Everything I've tried says a username is required, but the database itself doesn't have one, it just has the password portion.  Will that work with these options?
0
 

Author Comment

by:fcsIT
ID: 37798607
I just tried to create the linked server using your instructions, but ran into the same creditials problem I've been hitting using every other method.

How can I create a linked server to an Access database that is password protected, but has not username associated with that password?
0
 
LVL 77

Accepted Solution

by:
peter57r earned 1000 total points
ID: 37799752
I previously thought this was not possible but seeing your Q I had another look round and came on this..

http://social.msdn.microsoft.com/Forums/en-NZ/sqlgetstarted/thread/11a8b5e5-3f10-41db-bc1a-266cdc0aa072

Look nearly at the end of the thread.
0
 

Author Comment

by:fcsIT
ID: 37802325
Still no luck on this.  I found an article (wish I had copied the URL to it to post here) on Microsoft's site talking about this issue.  They said you have to jump through a lot of hoops to get a user account between the SQL Server and the server the Access db resides on, such as creating a temp directory, assigning it permissions, and several other things.

I'm abadoning this whole process and will either figure out a better way, or just have the users do it manually.

Thanks everyone for your help!
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

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

Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

656 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