Board index » delphi » Update query joining two tables

Update query joining two tables

I want to make a join query with only 2 tables.  I only want to update
one of the tables.  I used to use a TUpdateSql component when using BDE
controls.  How do I accomplish this with ADO components.
 

Re:Update query joining two tables


On the BeforeDelete event.
MyADOQuery.RecordSet.Properties['Unique Table'].Value :=
   'The Name of the table you want to restrict updates to' ;

Quote
RandChris wrote:
> I want to make a join query with only 2 tables.  I only want to update
> one of the tables.  I used to use a TUpdateSql component when using BDE
> controls.  How do I accomplish this with ADO components.

--
Guillermo Casta?o Acevedo
Gerente de Sistemas - Grupo Millennium Ltda
Guiller...@GrupoMillennium.com
http://www.GrupoMillennium.com

Re:Update query joining two tables


Quote
>I want to make a join query with only 2 tables.  I only want to update
>one of the tables.  I used to use a TUpdateSql component when using BDE
>controls.  How do I accomplish this with ADO components.

Ado Joins are normaly updateable.  Just limit the fields you change to one table
and it should work fine.
--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Re:Update query joining two tables


Perhaps it should, but it doesn't.  I did a left join on a second table
and now any attempt to edit or append records fails with a key violation
when I attempt to refresh the data.  I simply call cds.refresh and I get
this wondetful key violation.  I take out my left join and all works.
The exception is that I don't have the data from the joined table.  FYI
in no way am I attempting to change any data in the left joined table.
I know better.
Quote
Brian Bushay TeamB wrote:
>>I want to make a join query with only 2 tables.  I only want to update
>>one of the tables.  I used to use a TUpdateSql component when using BDE
>>controls.  How do I accomplish this with ADO components.

> Ado Joins are normaly updateable.  Just limit the fields you change to one table
> and it should work fine.
> --
> Brian Bushay (TeamB)
> Bbus...@NMPLS.com

Other Threads