PRB: Recordset Based on SQL Server View Updates Base Tables
This article was previously published under Q253673 On This PageSYMPTOMS
Trying to issue an Update or Resync command on a recordset based on a SQL Server view might generate the following error:
Run-time error '-2147217911 (80040e09)': SELECT permission denied on object <table_name>, database <db_name>, owner <owner_name> CAUSE
When ADO requests metadata for each column in the recordset (column name, table name, and so forth), SQL Server returns the base table name or names rather than the name of the view itself. ADO then uses this information to generate queries to resynchronize and update data.
RESOLUTION
To resolve this problem, grant users the appropriate permissions to the underlying base tables that the view is based upon. Typically, users need at least SELECT permission on the tables.
The Requery method can be used in place of the Resync method if it is necessary. However, there is a performance penalty with this option. If you are using SQL Server 2000, create the view with the View_MetaData clause of the Create View command. For this syntax and other information, see the SQL Server 2000 documentation. STATUS
This behavior is by design beginning with SQL Server version 7.0.
MORE INFORMATION
If a provider needs metadata information on a SQL statement, it queries the datasource to see what methods are available to it to request the metadata. If the data source responds with no native method of returning the metadata, the provider asks the Client Cursor Engine (CCE) to parse the SQL SELECT statement to figure out the metadata information long hand rather than relying on the more efficient method that was not available through the datasource. This code might work with other data sources. This is because many data sources do not have such built-in optimized methods of returning metadata, like SQL Server, regarding a SQL statement. Steps to Reproduce Behavior
APPLIES TO
| Article Translations
|
Back to the top
