RE: CReating Read-Only Link between tables?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi.

> I want to
> limit the user of database #2 to read-only access of the master table in
> database #1. Is this possible?

Yes. But you'll have to implement user-level security, which can be a royal
pain. Instead, I would suggest using a non-updateable remote query as the
data source for your forms and reports in database #2.

To do so, import the table structure -- but absolutely no data -- from
database #1 into database #2. For example purposes, we'll name this table
tblSales and database #1 as db1.mdb, which is located in the C:\Test
directory. Next, create a new query and paste the following SQL statement
into the SQL View Pane:

SELECT *
FROM [;DATABASE=C:\Test\db1.mdb].tblSales
UNION
SELECT *
FROM tblSales;

(Replace the name of the table with your table name and the path and file
name with your own for database #1.) Save and run this UNION query. Try to
change records, and you'll find that it's completely read-only. Use this
UNION query as the record source on forms, and the user in database #2 won't
be making any unauthorized changes.

The downside to this is that the query doesn't automatically update changes
in the data source, so if changes are made in the table in database #1 after
the query is run, then the user in database #2 won't see these changes
immediately. The form needs to periodically requery the remote database. To
do so, the following code will get the latest data from the record source, in
this case, tblSales in db1.mdb:

Me.Requery

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
Beware to those who use munged addresses: known newsgroup E-mail harvesters
for spammers are Ripley@xxxxxxxxxxxxxxx and scott@xxxxxxxxxxxxxxxxxx

- - -
When you see correct answers to your question posted in Microsoft's Online
Community, please sign in to the Community and mark these posts as "Answers,"
so that all may benefit by filtering on "Answered questions" and quickly
finding the right answers to similar questions. Remember that the first and
best answers are often given to those who have a history of rewarding the
contributors who have taken the time to answer questions correctly.


"jkyte" wrote:

> I am using Microsoft Access 2003. I have a master table in Database #1 and
> want to establish a link to this table in database #2. However, I want to
> limit the user of database #2 to read-only access of the master table in
> database #1. Is this possible?
>
> Stated alternatively, I want the user of database #2 to always have a copy
> of the content and structure of the master table in database #1 that
> automatically updates itself whenever the content of the master table
> changes, but I do not want to expose the master table to inadvertant or
> unintended changes or modifications caused by the user of database #2.
.



Relevant Pages

  • Re: Get custom database properties from an Access database
    ... I could start a local copy only if the master is unavailable. ... If my database gets hosed, or even the entire machine stolen, it doesn't matter, it's only a snapshot of the actual data and can be rebuilt any time it's necessary. ... Dim wshShell ...
    (microsoft.public.scripting.vbscript)
  • Re: Replication problems
    ... An error occurred while accessing the DHCP database. ... DHCP server event log for more information on this error. ... browser for the domain on transport NetBT_Tcpip_{99B638B5-2C0B. ... master browser is stopping or an election is being forced. ...
    (microsoft.public.windows.server.active_directory)
  • Re: DataGrid / DataSet Issue
    ... The connection string is where I went wrong. ... Microsoft Excel to connect to the database where I chose the tables I ... needed and then ran a query to get the data I wanted- after which I ... appearing to be master tables, were not master tables at all. ...
    (microsoft.public.dotnet.languages.vb)
  • RE: SQL Server failing to start (directly effecting sales!!!) Error: 823, Severity:
    ... You should consider calling Microsoft Technical Support as your master ... They will want your SQL Server Errorlogs ... that the machine with the database has hardware that is failing. ... Even if you are planning to reinstall you should make a backup copy ...
    (microsoft.public.sqlserver.msde)
  • Re: Table Normalization
    ... To master it requires a great deal more work. ... There are so many categories to work in (database design, queries, forms, ... that they'd flub a number of the answers, ... make the same mistake twice, and they don't let others make the same ...
    (microsoft.public.access.tablesdbdesign)