Hi.
I use 2 MSQuery in master/detail relantionship (named Q1 and QFloat).
I use stored procedure to update user input data from QFloat.
Stored procedure updates 2 tables (used in both MSQuery) on the server.
How can I refresh master datasourse (all or one record only) after updating some detail data?
Thank you.
Refreh Master in Master/Detail
Thanks.
The code below works fine.
Maybe, my little experience will be useful for other programmers.
If I don't call Refresh method for QFloat, next update for QFloat raise the exception:
The code below works fine.
Code: Select all
procedure TTirePrice.QFloatAfterUpdateExecute(Sender: TCustomMSDataSet;
StatementTypes: TStatementTypes; Params: TMSParams);
begin
if stUpdate in StatementTypes then
begin
if Integer(Params.ParamByName('RETURN_VALUE').Value)0 then
begin
MyMessage('Error '+'.'+chr(13)+'Code: '+String(Params.ParamByName('RETURN_VALUE').Value));
end;
Q1.Refresh;
QFloat.Refresh;
end;
end;
If I don't call Refresh method for QFloat, next update for QFloat raise the exception:
Exception class EAssertionFailed with message 'DisposeBuf failed (MemData.pas, line 6469)'.
Hi again.
Note please.
I try to edit QFloat data and catch the exception.
Process is:
1. I scroll to row number 100 (for example) of Q1.
2. I try to edit different rows of QFloat.
If I try to update twice the same row of QFloat, same exception (see my post upper) fires.
If I update other row of QFloat and then return to edit first row - it's OK.
Why it's happens and how to correct it?
PS
Code of procedure and exception text I posted earlier.
Note please.
I try to edit QFloat data and catch the exception.
Process is:
1. I scroll to row number 100 (for example) of Q1.
2. I try to edit different rows of QFloat.
If I try to update twice the same row of QFloat, same exception (see my post upper) fires.
If I update other row of QFloat and then return to edit first row - it's OK.
Why it's happens and how to correct it?
PS
Code of procedure and exception text I posted earlier.
We couldn't reproduce the problem.
Please send us (sdac*crlab*com) a complete small test project to reproduce the problem; it is desirable to use Northwind or Master schema objects, otherwise include definition of your own database objects; don't use third party components.
Also supply us following information
- Exact version of Delphi
- Exact version of SDAC. You can see it in About sheet of TMSConnection Editor
- Exact version of Microsoft SQL Server and OLE DB provider that you use. You can see it in Info sheet of TMSConnection Editor
Please send us (sdac*crlab*com) a complete small test project to reproduce the problem; it is desirable to use Northwind or Master schema objects, otherwise include definition of your own database objects; don't use third party components.
Also supply us following information
- Exact version of Delphi
- Exact version of SDAC. You can see it in About sheet of TMSConnection Editor
- Exact version of Microsoft SQL Server and OLE DB provider that you use. You can see it in Info sheet of TMSConnection Editor