Microsoft KB Archive/190635

= ACC97: "No Read Permission on..." Error After Compacting Database =

Article ID: 190635

Article Last Modified on 1/23/2007

-

APPLIES TO


 * Microsoft Access 97 Standard Edition

-



This article was previously published under Q190635



Advanced: Requires expert coding, interoperability, and multiuser skills.



SYMPTOMS
When you try to open a form or report, you may receive the following error message:

Record(s) can't be read; no read permission on ''



CAUSE
You may experience this problem when the following conditions are true:
 * You try to open a form or report.

-and-
 * The record source for that form or report is set to an SQL statement that uses WITH OWNERACCESS OPTION.

-and-
 * You do not have at least Read Data permissions on the table.

-and-
 * The database has been compacted since you last saved the form or report.



RESOLUTION
Instead of having the SQL statement as the record source of the form or report, create a query with the SQL statement. Then use the query as the record source of the form or report. This will guarantee that the form or report record source is not deleted if the database if compacted.



MORE INFORMATION
The SQL statement behind forms and reports creates a hidden query when you save the form or report. The WITH OWNERACCESS OPTION in the record source informs Microsoft Access to run the hidden query. When you compact the database, this query is deleted. The query will be created each time the form or report is saved.

Create the Database
 Start Microsoft Access. Log on as Admin. Create a new database named OwnerPer.mdb.  Create the following new table named tblNames:   Field Name   Data Type --  -   FirstName       Text   Open the tblNames table and enter the following data: <pre class="fixed_text">  Name: Nancy Name: Andrew </li>  Create a new form named frmNames and set the following form properties. (Accept the default for all other properties.) <pre class="fixed_text">  Form Properties ---  RecordSource: SELECT * FROM tblNames WITH OWNERACCESS OPTION; </li>  Add the following control to the frmNames form and set the properties of the control as indicated. (Accept the default for all other properties.) <pre class="fixed_text">  Text Box Name: FirstName ControlSource: FirstName </li></ol>

Set Permissions
<ol> On the Tools menu, point to Security, and then click User And Group Accounts.</li> Add a new user to the Users group named Janet.</li> On the Tools menu, point to Security, and then click User And Group Permissions.</li>  Give Janet the following permissions: <pre class="fixed_text">     tblNames: no permissions frmNames: Open/Run only </li>  Give the Users group the following permissions: <pre class="fixed_text">  tblNames: no permissions frmNames: Open/Run only </li> On the File menu, click Exit.</li></ol>

Reproducing Error Message
<ol> Start Microsoft Access. Log on as Janet.</li> Open the database OwnerPer.mdb.</li>  Open the form frmNames. <pre class="fixed_text">  Note that you are able to scroll through and edit the records. </li> On the Tools menu, point to Database Utilities, and then click Compact Database.</li>  Open the form frmNames. <pre class="fixed_text">  Note that you receive the error message described in the "Symptoms" section. </li></ol>

Additional query words: records can t be read

Keywords: kberrmsg kbprb KB190635

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.