Solved Link a table in ReadOnly mode (1 Viewer)

Capitala

Member
Local time
Today, 22:35
Joined
Oct 21, 2021
Messages
58
Good evening!
I need a code to link a table from an external database (protected with password) so that the linked table will be in ReadOnly mode in the destination database.
Thanks in advance
 

plog

Banishment Pending
Local time
Today, 16:35
Joined
May 11, 2011
Messages
11,645
You control that in the external database. Set up a user/password on it that limits the access to only SELECT queries.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 17:35
Joined
Feb 19, 2002
Messages
43,257
That is not an option unless the tables are in SQL Server or some other RDBMS. And even then, permissions would be defined at the server, NOT as the tables are linked.

You NEVER expose tables or queries to the user so you could make the form not updateable easily enough.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 14:35
Joined
Oct 29, 2018
Messages
21,467
Hi. Are you talking about an external Access database or SQL Server (or some other RDBMS)?
 

CJ_London

Super Moderator
Staff member
Local time
Today, 22:35
Joined
Feb 19, 2013
Messages
16,607
not sure you can with linked tables, as Pat says that would normally be handled in the external database

However, depending on what the backend is you can with a query. Assuming the backend is an access db, your query would look something like

Code:
SELECT *
FROM myTable IN '' [ms access;PWD=password;DATABASE=C:\pathtoBE\BEfilename.accdb]

Then change to the query view, open the query (not column) properties and change the Recordset Type from Dynaset to Snapshot
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 16:35
Joined
Feb 28, 2001
Messages
27,172
The others have emphasized that the backend DB controls this. I'll emphasize the OTHER facet of this problem, which Pat Hartman mentioned. If you are exposing your tables to your users, you have already lost this battle. If you only expose things via a form then you can use the form's abilities to block users from seeing/doing too much.

Search this forum for "Securing a database." That will provide MANY discussions of how to selectively protect your tables.
 

Capitala

Member
Local time
Today, 22:35
Joined
Oct 21, 2021
Messages
58
Thanks all, I'll try the best workable one.
Thanks again
 

Users who are viewing this thread

Top Bottom