G
Guest
I want to use an updatable view to restrict the records end users can access
and manipulate. The view reads as follows:
Create View Customers_vw
WITH VIEW_METADATA
As
Select *
From Customers
Where Office ID In (Select OfficeID From Agents Where Agent =
dbo.fnc_GetAgentID())
dbo.fnc_GetAgentID() is a user defined function that returns an id based on
a user’s login information. WITH VIEW_METADATA is a directive to ADO that
update requests should update the view and not the table directly.
I have granted all permissions on the view. The view is updateable if I
give users all permissions on the customers table, but that defeats my
purpose. The view is also updateable if I change the In clause to a set
value:
Select *
From Customers
Where Office ID = 10
The view with the In clause is updatable if I use it to populate an ADO
Recordset object in code. The view is also updatable through tools like
Enterprise Manager. It seems to be an Access problem. The problem occurs in
both 2002 and 2003 versions.
KB307925 offers some suggestions, but again the view is not updateable when
there is an In statement in the view.
Thanks
Rick
and manipulate. The view reads as follows:
Create View Customers_vw
WITH VIEW_METADATA
As
Select *
From Customers
Where Office ID In (Select OfficeID From Agents Where Agent =
dbo.fnc_GetAgentID())
dbo.fnc_GetAgentID() is a user defined function that returns an id based on
a user’s login information. WITH VIEW_METADATA is a directive to ADO that
update requests should update the view and not the table directly.
I have granted all permissions on the view. The view is updateable if I
give users all permissions on the customers table, but that defeats my
purpose. The view is also updateable if I change the In clause to a set
value:
Select *
From Customers
Where Office ID = 10
The view with the In clause is updatable if I use it to populate an ADO
Recordset object in code. The view is also updatable through tools like
Enterprise Manager. It seems to be an Access problem. The problem occurs in
both 2002 and 2003 versions.
KB307925 offers some suggestions, but again the view is not updateable when
there is an In statement in the view.
Thanks
Rick