Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Server 2008 R2 - Link to Access MDB,ACCDB from Access 2010

Status
Not open for further replies.

sparkbyte

Technical User
Sep 20, 2002
879
US
I have tried several ways to do this but here is a copy of the T-SQL script.

Code:
EXEC sp_addlinkedserver 
    @server = N'ACCESSDB', 
    @provider = N'Microsoft.ACE.OLEDB.12.0', 
    @srvproduct = N'Access 2010',
    @datasrc = N'D:\Access_BE.MDB'
GO

-- Set up login mapping using current user's security context
EXEC sp_addlinkedsrvlogin 
    @rmtsrvname = N'ACCESSDB',
    @useself = N'True',
    @locallogin = NULL, 
    @rmtuser = NULL, 
    @rmtpassword = Null
GO

-- List the tables on the linked server
EXEC sp_tables_ex N'ACCESSDB'
GO

[red]
Msg 7399, Level 16, State 1, Procedure sp_tables_ex, Line 41
The OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "ACCESSDB" reported an error. The provider did not give any information about the error.
Msg 7311, Level 16, State 2, Procedure sp_tables_ex, Line 41
Cannot obtain the schema rowset "DBSCHEMA_TABLES" for OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "ACCESSDB". The provider supports the interface, but returns a failure code when it is used.
[/red]

Thanks

John Fuhrman
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top