For example, we have a table TCustomers (Fid, FName) and view VCustomers (select Fid, FName from TCustomers)
So, we can write
Code: Select all
update VCustomers set FName = "Igor" where FId = 18
So, the problem is SDAC replaces the name of the view with appropriate table. If I write query like
Code: Select all
select * from VCustomers,
Code: Select all
update TCustomers set FName = "Igor" where FId = 18.
Of course the server will reject the transaction, because user doesn’t have permission to edit table TCustomers.
I wrote about a similar problem before (SQL Generator doesn't want to update VIEW http://forums.devart.com/viewtopic.php?f=6&t=24136)
I have to reading the forum and a little digging in the Sdac source code. So I found solution.
When query is opened, I manually replace table TCustomers with view VCustomers
Code: Select all
TDBAccessUtils.GetTablesInfo (TCustomDADataSet (DataSet)). Items [0]. TableName: = 'VCustomers';
Code: Select all
update VCustomers set FName = "Igor" where FId = 18 and.