Hi,
I use SDAC with D7 and now I have a problem with processing error events if occured.
So, I have something like that:
//**************************
try
TMSQuery(ExecQuery).Execute;
except
on E : EMSError do
begin
for I := 0 to E.ErrorCount - 1 do // Iterate
ShowMessage(E.Errors.Message);
end
else
ShowMessage('Unknown Error')
end;
//**************************
And I get 'Unknown Error' message every time error occures. An that is a problem.
I've found that EAbort error object throwed every time in this function.
Is it known issue? Can anyone help?
p.s.
In SDAC Help I found description for EOLEDBError object and there is a text : "Keep in mind, if MSConnection.Connect was called from another thread than this event, the text of the message can be incomplete."
May be it is a key for solving because of I use different threads in my application?
catch EMSError
Use the code
to get type of the error.
> May be it is a key for solving because of I use different threads in my
> application?
Possible. Pay attention that each thread must have its own set of SDAC components (TMSConnection + TMSQuery + etc).
Code: Select all
try
TMSQuery(ExecQuery).Execute;
except
on E : Exception do
ShowMessage(E.Message+#$D#$A+E.ClassName)
else
ShowMessage(\Unknown Error\)
end;
> May be it is a key for solving because of I use different threads in my
> application?
Possible. Pay attention that each thread must have its own set of SDAC components (TMSConnection + TMSQuery + etc).