This article was previously published under Q108439
Retired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
If you have a query based on an attached Oracle synonym that has a sort ona column name, and the owner of the synonym has read-only permissions onthe table on which the synonym is based, you will receive the errormessages:
This error occurs because the owner of the synonym has read-onlypermissions on the Oracle table on which the synonym is based.
There are four ways to correct this problem:
Create a Public synonym in Oracle.
In Microsoft Access, attach directly to the table on which the synonym is based.
In Oracle, assign the owner of the synonym permissions greater than read-only.
In Microsoft Access, remove the "order by" clause from the query.
The following is an example of an SQL statement that will cause thiserror:
SELECT * FROM <owner>.<synonym_name> ORDER BY <owner>.<synonym_name>.<column_name>
Note that the same errors will occur if this command is issued in SQL*DBAor SQL*PLUS, which are Oracle's interface tools. If you remove the ORDER BYclause, the statement will run. The statement will run with the ORDER BYclause if you remove the <owner>. clause instead. The statement will runwith all the clauses included if you increase the owner's permissions onthe table on which the query is based.
Steps to Reproduce Behavior
In Oracle, create a table. Assign all permissions on the table to user A, and read-only permissions to user B.
Log into Oracle as user A. Create synonym A based on the new table.
Log into Oracle as user B. Create synonym B based on the new table.
Start Microsoft Access. Attach synonym A with user A's login account. Create a query based on synonym A with a sort on one of the columns.
Run the query. Note that the query runs correctly.
Attach synonym B with user B's login account. Create a query based on synonym B with a sort on one of the columns.
Run the query. The error messages stated above will occur.
NOTE: You can reproduce this behavior in Oracle's SQL*DBA as well. To doso, connect as user A and issue the following command:
SELECT * FROM userA.synonymA ORDER BY userA.synonymA.column1;
Note that the command runs correctly. Next, connect as user B and issue thefollowing command:
SELECT * FROM userB.synonymB ORDER BY userB.synonymB.column1;