If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > ADOQuery tries to update underlying table of a view

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-23-05, 10:39
afx2029 afx2029 is offline
Registered User
 
Join Date: Oct 2003
Posts: 84
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?
Reply With Quote
  #2 (permalink)  
Old 02-23-05, 14:26
afx2029 afx2029 is offline
Registered User
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On