Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003
    Posts
    84

    Unanswered: ADOQuery tries to update underlying table of a view

    Hi,
    I Have a Table: Table1 and a view: View1.
    View1 returns a subset of the rows of Table1 (Only the rows the user should have access to). I give the user INSERT and UPDATE and SELECT permissions on the view. The View1 owner and Table1 owner are the same (DBO). I use a TADOQuery component with a TDataSource and a couple of controls linked to it.
    I run the app...it returns the right rows. The problem is when I try to make changes. When I try to INSERT or UPDATE a row (when I call post or UpdateBatch), I get a message saying I don't have UPDATE or INSERT permissions on Table1 (depending on the operation I performed). I don't understand why the ADO query is even trying to update the underlying table....
    when I run an insert statement in query analyzer on View1 (INSERT and/or UPDATE), everything works out fine. If I set INSERT/UPDATE permissions on the underlying table (Table1) everything works fine from the application, but I don't want to do this. Any ideas?

  2. #2
    Join Date
    Oct 2003
    Posts
    84
    .....SQL server was returning metadata on the select columns
    from the underlying because i didn't specify WITTH VIEW_METADATA in the
    view's create statement

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •