Re: batchoptimistic referesh data in second table in the join



I have Join sql fro two tables, i want after insert or edit to refresh the
other data

Example

SELECT dbo.[Order Details].OrderID, dbo.[Order Details].ProductID,
dbo.[Order Details].UnitPrice, dbo.[Order Details].Quantity,
dbo.Products.ProductName
FROM dbo.[Order Details] INNER JOIN
dbo.Products ON dbo.[Order Details].ProductID =
dbo.Products.ProductID

after inserting the ProductID and post in batchOptimistic AdoDataSet doesn't
update ProductName is kept empty

is there anyway to resolve this problem

You need to do a recordset Resync
with ADODataset1 do begin
UpDateCursorPos; {MUST ALWAYS DO!}
RecordSet.Resync(adAffectCurrent, adResyncAllValues);
ReSync([]); {May not be needed}
end;
But before that will work you need to set the "Resync Command" property
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdprodynresynccommand.asp

TBetterADOdataset which is a TAdoDataset descendant makes this a lot easer
http://betterado.hit.bg/
--
Brian Bushay (TeamB)
Bbushay@xxxxxxxxx
.