PRB: Recordset Based on SQL Server View Updates Base Tables (253673)
The information in this article applies to:
- Microsoft Data Access Components 2.0
- Microsoft Data Access Components 2.1
- Microsoft Data Access Components 2.1 (GA)
- Microsoft Data Access Components 2.1 SP1
- Microsoft Data Access Components 2.1 SP2
- Microsoft Data Access Components 2.5
- Microsoft Data Access Components 2.6
- Microsoft Data Access Components 2.7
- Microsoft SQL Server 7.0
- Microsoft Visual Basic Professional Edition for Windows 5.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 5.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
- Microsoft SQL Server 2000 (all editions)
This article was previously published under Q253673 SYMPTOMS
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.
Modification Type: | Major | Last Reviewed: | 11/7/2003 |
---|
Keywords: | kbDatabase kbprb kbServer KB253673 |
---|
|