SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Linked Server Access 2007
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

infodemers
Posting Yak Master

Canada
181 Posts

Posted - 11/08/2012 :  15:23:19  Show Profile  Reply with Quote
Hi,
I am creating a linked server on my SQL 2008 on a server with MS Office 2007 installed. I ran the following :
USE [master] 
GO 
EXEC master.dbo.sp_addlinkedserver @server = N'ACCESS', @srvproduct=N'access', @provider=N'Microsoft.ACE.OLEDB.12.0', @datasrc=N'\\blmcik\AccesQuery\SwitchDatabases\switch measures.accdb'
GO 

USE [master] 
GO 
EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname = N'ACCESS', @locallogin = NULL , @useself = N'False' 
GO


And I get the connection error saying:
Cannot create an instance of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "Access". (Microsoft SQL Server, error: 7302)

I also ran the following with no success:
USE [master]
GO

EXEC master . dbo. sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0' , N'AllowInProcess' , 1
GO

EXEC master . dbo. sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0' , N'DynamicParameters' , 1
GO

sunitabeck
Flowing Fount of Yak Knowledge

5155 Posts

Posted - 11/08/2012 :  16:13:43  Show Profile  Reply with Quote
That sounds almost like you don't have the ACE OleDB driver registered. Yet, you do have Office 2007 installed and that should have installed those drivers.

I tried the first two commands you listed on my box which has
SQL 2008 R2 and Office 2007 and they worked correctly. I could see the linked server from SQL.

In any case, I would check if you have the dlls - they would be in C:\Program Files\Common Files\Microsoft Shared\Office12 or Office14 or under corresponding directories under Program Files (x86) and named ACEOLEDB.DLL
Go to Top of Page

infodemers
Posting Yak Master

Canada
181 Posts

Posted - 11/08/2012 :  16:26:51  Show Profile  Reply with Quote
I could see the DLL files in the 2 folders you mentionned.
Also, when I create it, it shows in SQL instance, but I right click on it to run a connection test and then I receive the error message 7302.

Thanks and Regards!
Go to Top of Page

sunitabeck
Flowing Fount of Yak Knowledge

5155 Posts

Posted - 11/09/2012 :  07:04:57  Show Profile  Reply with Quote
I am seeing the same behavior, and I don't know what the solution is. If you do find out, please post back?
Go to Top of Page

infodemers
Posting Yak Master

Canada
181 Posts

Posted - 11/13/2012 :  14:05:32  Show Profile  Reply with Quote
FYI

I unchecked the "Allow inprocess" option in the Microsoft.ACE.OLEDB.12.0 provider and all is well now.

So it was not a good idea to set 'AllowInProcess' to 1

Edited by - infodemers on 11/13/2012 14:06:25
Go to Top of Page

sunitabeck
Flowing Fount of Yak Knowledge

5155 Posts

Posted - 11/13/2012 :  14:15:21  Show Profile  Reply with Quote
Very interesting - I have to resurrect my test code and see if that fixes it for me. Thanks for posting back.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.22 seconds. Powered By: Snitz Forums 2000