Page 1 of 1

No refresh joined field after insert

Posted: Wed 09 Apr 2008 12:20
by Alexander_73
Object TMSQuery, RefreshOptions=[roAfterInsert,roAfterUpdate],
Options.UpdateAllFields:=true

SQL Text:

Code: Select all

SELECT A.*, S.SendTypeName FROM AllFirmAddresses A
LEFT JOIN AA_LetterSendTypes S ON S.SendTypeID=ISNULL(A.SendTypeID,0)
WHERE FirmID=:FirmID
ORDER BY AddDate DESC, FirmName ASC
Insert SQL:

Code: Select all

INSERT INTO [AllFirmAddresses]
  ([FirmID], [FirmName], [Index], [Address], [Contact], [Note], [IsDefault], [AddDate], [SendTypeID])
VALUES
 :[FirmID], :[FirmName], :[Index], :[Address], :[Contact], :[Note], :[IsDefault], :[AddDate], :[SendTypeID])
SET :[ID] = SCOPE_IDENTITY()
Refresh SQL:

Code: Select all

SELECT A.*, S.SendTypeName FROM [AllFirmAddresses] A
LEFT JOIN AA_LetterSendTypes S ON S.SendTypeID=ISNULL(A.SendTypeID,0)
WHERE
  A.[ID] = :[ID]
After inserting of new record (Query.Insert) and posting (Query.Post) record appears in the DBGrid, but column SendTypeName remains empty until the Query will not be closed and opened again. At Editing (Query.Edit) and posting (Query.Post) the column SendTypeName changes at once. How to receive value of a column without reopening query?

Posted: Wed 09 Apr 2008 14:37
by Antaeus
I could not reproduce the problem.
Please send me a complete small sample at sdac*crlab*com to demonstrate it, including script to create and fill table.

Also supply me the following information:
- exact version of SDAC. You can see it in the About sheet of TMSConnection Editor;
- exact version of your IDE;
- exact version of SQL server and client. You can see it in the Info sheet of TMSConnection Editor.