Reputation: 965
We have one .exe application that uses one .mdb Microsoft Access database.
I need to access data inside access file over Microsoft SQL Server. We have SQL Server 2008 R2 Enterprise that has linked server pointed to this Access file and I can run select / update query using SQL statement.
SELECT * FROM [LinkedServerAccessDB]...[SomeTable]
How can I configure that this linked server, my Access database, is directly published as "Database" when some application tries to connect to my SQL Server using SQL Server instance name, and username and password. Which "database name" should I use to use directly linked server ?
Thank you
Upvotes: 2
Views: 1890
Reputation: 52675
You can use CREATE SYNONYM like so.
USE ASQLServerDB
GO
CREATE SYNONYM Sometable FOR LinkedServerAccessDB...SomeTable
Once this is done you can write SELECT [...] from SomeTable
as though it was a member of the database ASQLServerDB
I was only able to get it to work at the object level so you'll need to do this for each object you want to expose. You could create an empty database that just contained these Synonyms if you wanted to get that "published as a database" feel.
--This doesn't work
CREATE SYNONYM Sometable FOR LinkedServerAccessDB...
Upvotes: 1
Reputation: 100607
It sounds like you want your MS Access Linked Server object available as a database (i.e. available in the 'Databases' folder in SSMS). This isn't possible, directly.
Suggest you create a new SQL Server database that mimics the name of that Access database. Map a user to that login you've got above. Allow the user to run queries against the linked server.
Upvotes: 3