Page 1 of 1
Problem with StatementTypes of BeforeUpdateExecute event
Posted: Tue 14 Nov 2006 16:11
by Balaji
Hi,
We have an licenced 3.80.0.32 version of SDAC components.
The StatementTypes value of Query component is returning me stupdate even in the case of insert, delete or update operations in the BeforeUpdateExecute event of Query component.
This problem i am facing specifically when i am obtaining the IdentitKey value from Database.
Can you please help me in knowing and using stInsert, stDelete and stQuery values of StatementTypes in the event.
Thanks in advance.
Posted: Wed 15 Nov 2006 14:09
by Jackson
We couldn't reproduce the problem.
Please send us (evgeniym*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 or C++ Builder
- 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
Posted: Thu 23 Nov 2006 05:26
by Japhar
Hi,
I too got this problem. But to solve the problem i have modified the code in DBACCESS.pas file of TCustomDAUpdateSQL.ExecSQL procedure.
Core Lab: Can you please let me know the code which i have written is required or it could lead any problem?
procedure TCustomDAUpdateSQL.ExecSQL(UpdateKind: TUpdateKind);
//Added new varibale of type TStatementTypes
var
StatementTypes: TStatementType;
//End adding.
begin
//Commented Core lab code here...Because stUpdate is hardcoded.
// FDataSet.PerformSQL(FSQLText[UpdateKind].Text, [stUpdate]);
//Added below code to set the StatementType according to the UpdateKind.
if (UpdateKind = ukModify) then
begin
StatementTypes := stUpdate;
end Else if (UpdateKind = ukInsert ) then
begin
StatementTypes := stInsert;
end Else if (UpdateKind = ukDelete ) then
begin
StatementTypes := stDelete;
end;
FDataSet.PerformSQL(FSQLText[UpdateKind].Text, [StatementTypes]);
//End Adding.
end;
Posted: Thu 23 Nov 2006 09:23
by Jackson
Thank you for information.
We have reproduced the problem and have fixed it.
This fix will be included in the next SDAC build.
Please watch for announcements at the forum.
Posted: Thu 23 Nov 2006 09:48
by Jackson
Your fix is correct. You can use it as a temporary solution until new build of SDAC is released.
Posted: Fri 24 Nov 2006 04:55
by Japhar
Thanks for your information.....
