Re: How to use ADO Seek Method With Multiple Columns



Thank you for responding. To clarify, I'm updating fields in Table A with
a
PK from Table B. The new value for the A.<Field> depends on the matching
row
in Table B. I don't know the value beforehand.

Well that is a complex SQL UPDATE.
But in all honesty, issuing a complex UPDATE is faster than coding a
solution where you do intermediate bits yourself
In general : let the database do the work. If it can be done with SQL then
do so. There wil lbe less programming errors as well.

UPDATE table1 SET field1 = t2.field2
FROM table1 t1 JOIN table2 t2 ON t1.field3=t2.field4
WHERE t1.field1 <> t2.field2

In this case field1 in table1 is updated to field2 from table2 on the basis
of the JOIN on other fields between the tables.
That ON clause will usually be some PK match fields

And I have reduced the work slightly by excluding all the entries which are
identical in the WHERE clause.
Any other redunant row reducing measures should be added to WHERE clause to
get a fast update.
All this can be done by via a ADO Connection Execute.

Stephen Howe




.