SQL Server: How to Linked Server an Access Database

Below is the script to create a linked server to an Access database:

EXEC master.dbo.sp_addlinkedserver 
@server = N'MyLinkedServerAccessDB',
@srvproduct = N'Access',
@provider = N'Microsoft.Jet.OLEDB.4.0',
@datasrc = N'C:\MyAccessDB.mdb'


Plus you also need to create the linked server login.  What’s important to note here is that the password for the admin account in the Access database is blank by default, unless you have set the password.

EXEC master.dbo.sp_addlinkedsrvlogin 
@rmtsrvname = N'MyLinkedServerAccessDB',
@useself = N'False',
@locallogin = N'sa',
@rmtuser = N'admin',
@rmtpassword = ''


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s