ACC1x: Cannot db.OpenTable with Only Read Definition Permission

Last reviewed: May 28, 1997
Article ID: Q92811
The information in this article applies to:
  • Microsoft Access versions 1.0, 1.1

SYMPTOMS

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

When you have only Read Definition permissions on a table, you are unable to open the table in order to examine the table definition from Access Basic and you may receive the following error message:

   No permission for '<Tablename>' (versions 1.x)

CAUSE

The table cannot be opened from Access Basic when you have only Read Definition permission. You should have users Read Data permission for the table if you need to examine the table definition with Access Basic.

If you have Read Definition permission, you can only look at the table definition manually by opening the table in Design view as read-only.

STATUS

This behavior is by design.

NOTE: This behavior does not exist in Microsoft Access version 2.0 because of the ability to use data access objects (DAO) in Access Basic to obtain the table definition. Instead of attempting to open a Table variable (as shown below) which includes the data, you can open a Tabledef object, which does not include data. Therefore, no error will occur.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Open a new database and create a table called Table1.

  2. Add a new user named Joe and give this user Read Definition permission only on the Table1 table.

  3. Quit Microsoft Access, and restart Microsoft Access and log on as Joe. (Be sure you have removed all permissions from the group Users because everyone who logs on to Microsoft Access is a member of the group Users.)

  4. Enter the following code in a new module:

          Option Explicit
    
          Sub Test ()
             Dim Mydb As Database
             Dim MyTable As Table
             Set Mydb = CurrentDB()
             Set MyTable = mydb.OpenTable("Table1")
             MyTable.MoveFirst
             MyTable.Close
             Mydb.Close
          End Sub
    
    

  5. Run this Sub procedure by typing "test" (without the quotation marks) in the Immediate window. Note that you receive the following error message displayed:

          No permission for '<Tablename>'
    


Additional query words: rights
Keywords : kbusage ScrtOthr
Version : 1.0 1.1
Platform : WINDOWS
Hardware : X86
Issue type : kbprb
Resolution Type : Info_Provided


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: May 28, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.