Don't want to delete from secondary table

Don't want to delete from secondary table

Post by Jon Jacob » Fri, 27 May 2005 06:42:20


I use a TADOQuery with...
Select * from LoanView Where OrdNo=:OrdNo

The LoanView was created like this...
Create View LoanView
AS

Select OrdNo,LoanSort,Lender,Name,LoanAmount,LoanNumber,MonthlyPI,MortInsCaseNumber,
InterestRate,LoanPolicyLiability,IsPrimary,IsSecondary
From Loans
Left Outer Join Agent on AgentNum=Lender


I use the view with the join because I want to show the Name from the Agent table in my grid.


I have a TwwDBGrid with a TDBNavigator using a DataSource using the query.

If I click the - on the navigator, to delete a record, it tries to delete the Agent record as well as the Loana record.

How can I make this only delete the record in the main underlying table (Loans)?


Thanks,

Jon
 
 
 

Don't want to delete from secondary table

Post by Jon Jacob » Sat, 28 May 2005 12:17:40

Thank you very much. Unfortunately it didn't work. Finally I did it brute-force. In OnBeforeDelete method I delete the
record in the underlying main table and abort the original delete.

Jon

--- Brian Bushay TeamB wrote on 05/25/2005 21:13:35 :